I need help with this program--creating classes

Create a class called Robot (living in a 2-dimensional city of streets and avenues) with the following characteristics:

string cityName
int street (run horizontally thru the city, think as rows)
int avenue (run vertically through the city, think as columns)
string direction (east, west, south, north)

and the following operations:

Robot(string city, int str, int ave, string dir) // constructor
int getStreet()
int getAvenue()
string getDirection()
string getCityName()
void move()
void printRobotData()

The get functions return the data listed in the function name. The move function updates either the street or avenue depending on the direction the Robot is facing. For example if the street is 3 and the avenue is 2 and the Robot is facing east, a move call will add 1 to the avenue, if facing south it would add 1 to the street. The print function outputs all of the data in a formatted fashion. Next create a class RobotSE that inherits from Robot adding the following:

int numberOfThingsInBackpack
int getThingsInBackpack() // returns things
void move(int times) // overrides Robot version to move times intersections in the direction facing
string getIntersection() // returns street and avenue in the format of "(street, avenue)"

Remember that you have to pass the data back to the parent class's constructor.
Do you have a question?
Last edited on
As Marissa Tomei said in My Cousin Vinny, "it's a bullshit question."

Everyone* knows that streets increase when you go north and avenues increase when you go west. Sheesh!!


* "Everyone" means New Yorkers, who think that no one, and no where, else exists.
:) :)
Does it follow that if you go far enough South-East there's just a really really huge single city block, and if you go far enough North-West at point it's all street?
Topic archived. No new replies allowed.