Description
Part A
Using an IDE, run the simple C++ program included with this homework in an IDE. Students in previous C++ courses like Microsoft’s VisualStudio, which is available for Windows, Linux and MacOS. Eclipse is another. Feel free to use another one, if you like. Take a screen shot of the screen after running the program in the IDE, and turn it in to Brightspace.
Part B.
Part i.
“”+std::to_string(mm)+”/”+std::to_string(dd)+”/”+std::to_string(yy);
where “mm”, “dd” and “yy” are the integer variables holding the month, day and year, respectively.
The constructor for automobile takes values for each of the variables, and for the month, day and year, i.e., it will take an int, float, int, int and int.
A separate file, HW1.cpp will be created that contains the main function. It should call the constructor twice to create two Automobile objects, and then print out the values of each automobile using
std::cout << <string to be printed> << std::endl;
Part ii.
You should be able to run an unchanged HW1.cpp against the changed Automobile class and get the same results you got with the original Automobile class.
How to turn in the homework.
Create a directory called <userid>, where <userid> is your Purdue login. Under that directory should be an A and a B directory. Inside of A directory have the screenshot for A. Inside of the B directory have two directories, 1 and 2. Inside the 1 directory have the code for part i above and a makefile such that “make” compiles and runs the code. Inside the 2 directory have the code for part ii above and a makefile that compiles the code. Turn in the code to Brightspace.
Reviews
There are no reviews yet.