Question: ############################################################### # Program: # Checkpoint 06a, Makefiles # Brother {Burton, Falin, Ercanbrack}, CS165 # Author: # your name here # Summary: # Summaries are not

 ############################################################### # Program: # Checkpoint 06a, Makefiles # Brother {Burton, Falin,

###############################################################

# Program:

# Checkpoint 06a, Makefiles

# Brother {Burton, Falin, Ercanbrack}, CS165

# Author:

# your name here

# Summary:

# Summaries are not necessary for checkpoint assignments.

###############################################################

# Insert your rule for a.out here:

# Insert your rule for robot.o here:

# Insert your rule for point.o here:

# Insert your rule for check06a.o here:

/******************************************

* File: robot.cpp

*

* You should not need to change this file.

******************************************/

#include "robot.h"

#include

using namespace std;

/**************************************

* Setters

**************************************/

void Robot :: setPosition(Point position)

{

this->position = position;

}

void Robot :: setEnergy(int energy)

{

if (energy

{

this->energy = 0;

}

else

{

this->energy = energy;

}

}

/************************************

* Function: Display

* Purpose: Displays the robot.

************************************/

void Robot :: display() const

{

position.display();

cout

}

/******************************************

* File: point.cpp

*

* You should not need to change this file.

******************************************/

#include "point.h"

#include

using namespace std;

/******************************************

* Setters

******************************************/

void Point :: setX(int x)

{

if (x

{

x = 1;

}

else if (x > 10)

{

x = 10;

}

this->x = x;

}

void Point :: setY(int y)

{

if (y

{

y = 1;

}

else if (y > 10)

{

y = 10;

}

this->y = y;

}

/******************************************

* Function: display

* Purpose: Displays the point

******************************************/

void Point :: display() const

{

cout

}

/*******************************************

* File: check06a.cpp

*

* You should not need to change this file.

*******************************************/

#include

using namespace std;

#include "robot.h"

int main()

{

Robot r;

cout

r.display();

cout

return 0;

}

/******************************************

* File: robot.h

*

* You should not need to change this file.

******************************************/

#ifndef ROBOT_H

#define ROBOT_H

#include "point.h"

class Robot

{

private:

Point position;

int energy;

public:

void display() const;

Robot()

{

energy = 100;

}

Robot(int energy)

{

setEnergy(energy);

}

Robot(Point p, int energy)

{

setPosition(p);

setEnergy(energy);

}

Point getPosition() const { return position; }

int getEnergy() const { return energy; }

void setPosition(Point position);

void setEnergy(int energy);

};

#endif

Overview This checkpoint is intended to help you practice the syntax of separate compilation and makefiles. You will be provided a simple class and asked to prepare a makefile to perform the separate compilation and the linking required to produce a final executable Instructions Begin with a working implementation of a robot and point class from last weeks team activity. You can copy this code to your directory via the following: mkdir check06a cd check06a cp /home/cs165new/check06a/* . This code contains an empty makefile (with the header information you need to fill out). Your task is to open this makefile (e.g., "emacs makefile") and add the necessary rules to compile the executable Please make note of the following instructions requirements: 1. The implementation of the robot class is in robot.cpp 2. The implementation of the point class is in point.cpp 3. The main function is in check06a.cpp 4. You must set up your makefile to compile these separately. In other words, your makefile must create robot.o, point.o, and check06a.o first. 5. Then, your make file should link all of the.o files together to produce a final executable (a.out) 6. Each rule in the makefile should list all of its dependencies. Test this by trying the following cases (plus more) - Change check06a.cpp, this should update check06a.o and a.out Change robot.cpp, this should update robot.o and a.out - Change robot.h, this should update robot.o, check06a.o, and a.out 7. Please note that the makefiles we have been using to this point (for team activities and prior assignments) DO NOT use separate compilation. They simply list all of the.cpp files in the same "g++" command. This is NOT sufficient for this assignment. Sample Output The following is an example of output for this program: Robot details: (5, 5)- Energy: 100 Testbed An auto-grading testbed script is provided for you to help evaluate your program. This same testbed script will be used to grade our program. It is pass/ fail, so your program must pass the testbed completely for you to receive credit for this assignment. You may run the testbed as many times as you like Please note that it is possible to do this assignment without a makefile that adheres to all of the requirements above, but this will not help you understand the concept, and you will not receive credit if you do not follow the instructions. Overview This checkpoint is intended to help you practice the syntax of separate compilation and makefiles. You will be provided a simple class and asked to prepare a makefile to perform the separate compilation and the linking required to produce a final executable Instructions Begin with a working implementation of a robot and point class from last weeks team activity. You can copy this code to your directory via the following: mkdir check06a cd check06a cp /home/cs165new/check06a/* . This code contains an empty makefile (with the header information you need to fill out). Your task is to open this makefile (e.g., "emacs makefile") and add the necessary rules to compile the executable Please make note of the following instructions requirements: 1. The implementation of the robot class is in robot.cpp 2. The implementation of the point class is in point.cpp 3. The main function is in check06a.cpp 4. You must set up your makefile to compile these separately. In other words, your makefile must create robot.o, point.o, and check06a.o first. 5. Then, your make file should link all of the.o files together to produce a final executable (a.out) 6. Each rule in the makefile should list all of its dependencies. Test this by trying the following cases (plus more) - Change check06a.cpp, this should update check06a.o and a.out Change robot.cpp, this should update robot.o and a.out - Change robot.h, this should update robot.o, check06a.o, and a.out 7. Please note that the makefiles we have been using to this point (for team activities and prior assignments) DO NOT use separate compilation. They simply list all of the.cpp files in the same "g++" command. This is NOT sufficient for this assignment. Sample Output The following is an example of output for this program: Robot details: (5, 5)- Energy: 100 Testbed An auto-grading testbed script is provided for you to help evaluate your program. This same testbed script will be used to grade our program. It is pass/ fail, so your program must pass the testbed completely for you to receive credit for this assignment. You may run the testbed as many times as you like Please note that it is possible to do this assignment without a makefile that adheres to all of the requirements above, but this will not help you understand the concept, and you will not receive credit if you do not follow the instructions

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!