Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hello! Could I get some help on this project? Thank you! Proj6.cpp (as mentioned in project instructions): /* This file is a test driver for

Hello! Could I get some help on this project? Thank you!image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

Proj6.cpp (as mentioned in project instructions):

/* 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;

}

CS 202 - Computer Science II Project 6 Due date (FIXED): Wednesday, 3/14/2017, 11:59 pm 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 2 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. The Vehicle Class will contain the following protected data members m lla, a float array of size 3 which represents the location of the vehicle on the earth (LLA stands for Latitude-Longitude-Altitude, which are the 3 values stored within the array). and will have the following private methods: A virtual serialize method, which returns nothing, and takes in a std:ostream object by-Reference. It inserts into that stream object (employing insertion 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 2 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. The Vehicle Class will contain the following protected data members m lla, a float array of size 3 which represents the location of the vehicle on the earth (LLA stands for Latitude-Longitude-Altitude, which are the 3 values stored within the array). and will have the following private methods: A virtual serialize method, which returns nothing, and takes in a std:ostream object by-Reference. It inserts into that stream object (employing insertion

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Databases Illuminated

Authors: Catherine M. Ricardo, Susan D. Urban, Karen C. Davis

4th Edition

1284231585, 978-1284231588

More Books

Students also viewed these Databases questions

Question

=+6. What five driving forces make CSR more relevant today?

Answered: 1 week ago