Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

CISP 400 Midterm 2name You must write legibly to receive full credit on this exa

ID: 3700646 • Letter: C

Question

CISP 400 Midterm 2name You must write legibly to receive full credit on this exam fI cannot decipher your writing you will receive a deoreased grade. For questions 1-6 consider the following coder include ciostrean> using hanespace std conat double AVGOOST 20000 const double BERTH TAX1.1 enum BoatType1 tug, sall class Boat double _price; BoatType BoatType publie: Boat { -price-02) Boat ( double p ) { -price . P; }; double Price { }const( return ( -price ); } doubles Price ( returnpricea i bool AboveAverage ( ) corat { return ( Price() > AVOCO ST ); }, virtual BoatType TypeDfBoat ()conat-0 class Pleasureboat : publie Boat double sails publie: Pleasureboat Pleasureboat 1 double p, double s-211 Bost (pl. ails(s) a class WorkBoat: public Boat double payload: public: WorkBoat t WorkBoat t double p, double pl 1Boat (p) I payload pli a BoatType TypeofBoat const ( return t tug : 1 bool Abovekveraget const I returnt Price)AVGOOST BERTH TAX a l a conat unsigned NOMBER-3 int main t PleasureBoat PB1 (190001 WorkBloat WB1 119950, 1.001 WorkBoat WB2 (20001,1.00) return 0

Explanation / Answer

Base: TypeOfboat()

Its a pure virtual function that is declalred in abstract class called BOAT.
All the dereived classes that inherits the base class will implement the function and return different value according to thier need.


false false false

false

19000 < 20000 hence false