Question: Can you please help me with this? its for C++ !! WIll give thumbs up! SAMPLE CODE BELOW SAMPLE CODE /** * @brief CS-202 Project

Can you please help me with this? its for C++ !! WIll give thumbs up! SAMPLE CODE BELOW

Can you please help me with this? its for C++ !! WIllgive thumbs up! SAMPLE CODE BELOW SAMPLE CODE /** * @brief CS-202Project 6 Test Driver * @date Summer, 2018 * * This fileis a test driver for the Polymorphic classes prescribed in Project 6of CS-202 */ #include #include "Car.h" using namespace std; int main(){ cout"//////////////////////////////// " "///// Constructor Tests ///// " "////////////////////////////////" cout Car c1; coutfloat lla_rno[3] = {39.54, 119.82, 4500.0}; Car c_rno(lla_rno); cout Car c_cpy( c_rno

SAMPLE CODE

/**

* @brief CS-202 Project 6 Test Driver

* @date Summer, 2018

*

* This file is a test driver for the Polymorphic classes prescribed in

Project 6 of CS-202

*/

#include

#include "Car.h"

using namespace std;

int main(){

cout

"//////////////////////////////// "

"///// Constructor Tests ///// "

"////////////////////////////////"

cout

Car c1;

cout

float lla_rno[3] = {39.54, 119.82, 4500.0};

Car c_rno(lla_rno);

cout

Car c_cpy( c_rno );

cout

c1 = c_cpy;

cout

"///////////////////////////////// "

"///// Polymorphism Tests ///// "

"/////////////////////////////////"

cout

Objects"

float lla_new[3] = {37.77, 122.42, 52.0};

c1.Move( lla_new );

cout

Objects"

cout

// Just setting some distinct values to our objects again here

float lla_ny[3] = {40.71, 74.00, 10.0};

c1.SetLLA( lla_ny );

float lla_la[3] = {34.05, 118.24, 71.01};

c_cpy.SetLLA( lla_la );

cout

"/////////////////////////////////////////////////// "

"///// Polymorphic Base Class Pointer Tests ///// "

"///////////////////////////////////////////////////"

Vehicle* vehicles_array[3];

vehicles_array[0] = &c1;

vehicles_array[1] = &c_rno;

vehicles_array[2] = &c_cpy;

cout

for (int i=0; i

vehicles_array[i]->Move( lla_new );

}

cout

Pointers"

for (int i=0; i

cout

}

cout

"//////////////////////////// "

"///// Tests Done ///// "

"////////////////////////////"

return 0;

}

Objectives: The main objectives of this project is to test your ability to create and use polymorphism with C++ classes. A review of your knowledge to manipulate classes with multiple constructors, static members/functions, operator overloading, inheritance, as well as pointers, structs, arrays, iostream, file I/O and C-style strings is also included. Description: For this project you may use square bracket-indexing, pointers, references, all operators, as well as the or library functions (however the std::string type is still not allowed) This project expands on a more simplified version of Project 5. The required functionality is as follows: You are given the specifications for a 3 Classes that have an Inheritance relationship - one being the Base class (Vehicle) and one the Derived class (Car). You have to translate these specifications into class implementations (header and source files) and test them against a test driver (proj6.cpp) which is provided. You are also required to explain in your documentation the observed output from running the test driver

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!