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:
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 evaluatedStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started