Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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:

image text in transcribed

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

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

Step: 3

blur-text-image

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

Repairing And Querying Databases Under Aggregate Constraints

Authors: Sergio Flesca ,Filippo Furfaro ,Francesco Parisi

2011th Edition

146141640X, 978-1461416401

More Books

Students also viewed these Databases questions

Question

13. You always should try to make a good first impression.

Answered: 1 week ago