-2

i am required to program a remotely piloted vehicle (RPV) that will navigate a given terrain and determine the number of craters and their locations in that terrain.I have a skeleton program....need help finishing it..

code:

Position class
class Position 
{
private:
int row;
int column;
public:
Position(); 
void SetRow(int r);
void SetColumn(int c); 
int GetRow(); 
int GetColumn(); 
}
Terrain class 
#define N 25 
class Terrain
{
private:
int rowsize; 
int columnsize; 
int gridmap[N][N]; 
public:
Terrain(); 
Terrain(int m, int n); 
void LoadMap(ifstream &input); 
void PrintMap(); 
int GetElevation(int i, int j); 
int GetRowSize(); 
int GetColumnSize(); 
};
RPV class 
class RPV
{
private:
Position position; 
Position CratersFound[MAXSIZE]; 
int TotalCraters; 
void MarkCraterPosition(); 
bool PositionIsCrater(Terrain *terrain);
4
Contributors
3
Replies
4
Views
7 Years
Discussion Span
Last Post by hag++
0

first things first, try to make your code more readable by indentation for example

class Position 
{
  private:
         int row;
         int column;
  public:
       Position(); 
       void SetRow(int r);
       void SetColumn(int c); 
       int GetRow(); 
       int GetColumn(); 
}

Also where are your methods and what is in them ?

Edited by elsiekins: n/a

0

I have a feeling this "skeleton code" was the code given to you by the teacher. This isn't a finish your homework for you club.

Edited by hag++: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.