Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon.

Pages: 1-

Validate your credentials

Name: Master Yi 2012-11-05 11:35

I am here to assess your skills as a community:

Instructions
1.  Create a Hexagonclass with:
a.  Two member variables, one used to hold the size of the hexagon, one to hold its
type
b.  Appropriate getters/setters for the member variables
c.  A suitable constructor
2.  Write a program that:
a.  Asks the user to enter the size of the hexagon, as well as its type
b.  Creates an instance of the Hexagonclass, and sets its size and type to that input by
the user
3.  Add a displaymethod to the Hexagonclass
a.  This should print hexagon shapes like those shown above, using the size and type
contained in the object’s member variables
b.  Adjust the above program so that it allows the hexagon to be printed using the
display method
4.  Add an option to your program to repeat the drawing with a hexagon of a different size and
type, until the user chooses to exit.


Language - C++

Name: Anonymous 2012-11-05 11:35

I'm here to ask you to make my homework
Fuck off back to /g/, fagshit.

Name: Anonymous 2012-11-05 12:12


#include <stdio.h>

typedef struct Hexagonclass{
    int size, type;
} Hexagonclass;

main()
{
    Hexagonclass hex;

    printf("HEXAGONCLASS SIZE PLEASE: ");
    scanf("%d", &hex.size);
    printf("\nHEXAGONCLASS TYPE PLEASE: ");
    scanf("%d", &hex.type);
    printf("%d, %d", hex.size, hex.type);
}


Then ``like those shown above'' referenced a NULL.

Name: Anonymous 2012-11-05 14:31

What the fuck is the "type" of a hexagon?

Name: Anonymous 2012-11-05 14:48

>>4
Hexagonclass, moroth. Can't you read?

Name: Anonymous 2012-11-05 14:48

_____
/-----\
/ \
/---------\
/ \
/-------------\
\ /
\-----------/
\ /
\-------/
\_____/

Name: Anonymous 2012-11-05 15:37

>>4
Its number of sides. What else could that possibly mean?
The type is always 6.

Name: Anonymous 2012-11-05 16:36

>>3

Language is C++, you don't need to typedef struct, just

struct Hexagonclass {
  int size, type;
  Hexagonclass(int s, int t) { size = s; type = t; }
};

Name: Anonymous 2012-11-05 16:44


hexagon is 2d pig disgusting

icosahedron is the perfect shape
icosahedron master race

Name: Anonymous 2012-11-05 16:55

>>8
s/struct/class/
also YHBT

Name: Anonymous 2012-11-05 21:30

validate my doubles

Don't change these.
Name: Email:
Entire Thread Thread List