Question: easy C++ question (NEED HELP ASAP) please answer according to the given template: don't forget to explain the code using comments Question: Template: #include Vehicle.hh

easy C++ question (NEED HELP ASAP) please answer according to the given template:

don't forget to explain the code using comments

Question:

easy C++ question (NEED HELP ASAP) please answer according to the given

Template:

#include "Vehicle.hh" #include "Ship.hh" #include using namespace std;

// *** DEFINE --VEHICLE-- FUNCTIONS FOR PART 1 ***

// *** DEFINE --SHIP-- FUNCTIONS FOR PART 2 ***

void reduceSpeed(Ship*, float); void takePassenger(Ship*, int);

int main() {

return 0; }

// reduce the speed of ship given in percentage (0

// takes the number of passengers to the ship void takePassenger(Ship *s, int pas) { // *** FILL THIS FUNCTION FOR PART 4 *** }

Ship Class:

#include "Vehicle.hh"

class Ship: public Vehicle { private: int passenger;

public: Ship(); Ship(int, float, float);

int getPassenger(); void setPassenger(int);

void print(); };

Vehicle Class:

#ifndef _Vehicle_hh_ #define _Vehicle_hh_

class Vehicle { private: float speed; float mile; public: Vehicle(); Vehicle(float, float);

float getSpeed(); float getMile();

void setSpeed(float); void setMile(float);

void print(); };

#endif

Thank You,

correct answers will be rated

Part I (25 point) Define functions corresponding to the Vehicle header file. Part II (25 point) Define functions corresponding to the Ship header file. Part III (25 point) Write a function that reduces the speed of the given ship. Part IV (25 point) Write a function that takes the given number of passenger to the ship. Note: Submit your answers by filling the given template. Note: Do not forget to justify your answers with comments. The codes without comments will not be evaluated

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!