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);

Recommended Answers

All 3 Replies

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 ?

Terrain class

Was this intended to be a comment?

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.