Home /
Expert Answers /
Computer Science /
on-c-given-class-triangle-in-files-triangle-h-and-triangle-cpp-complete-main0-to-read-and-set-t-pa812
(Solved): on C++ Given class Triangle (in files Triangle.h and Triangle.cpp), complete main0 to read and set t ...
on C++
Given class Triangle (in files Triangle.h and Triangle.cpp), complete main0 to read and set the base and height of trianglet and of triangle2, determine which triangle's area is smaller, and output that triangle's info, making use of Triang le's relevant member functions. Ex: If the input is: \[ \begin{array}{ll} 3.0 & 4.0 \\ 4.0 & 5.0 \end{array} \] where \( 3.0 \) is triangle1's base, \( 4.0 \) is triangle1's height, \( 4.0 \) is triangle2's base, and \( 5.0 \) is triangle2's height, the output is: Triangle with smaller area: Base: \( 3.00 \) Height: \( 4.00 \) Area: \( 6.00 \)
\( 7.23 \) LAB: Car value (classes) Given main0. complete the Car class (in files Car.h and Car.cpp) with member functions to set and get the purchase price of a car (SetPurchasePrice(). GetPurchasePrice()), and to output the car's information (Printinfo.0). Ex: If the input is: \[ \begin{array}{l} 2011 \\ 18000 \\ 2018 \end{array} \] where 2011 is the car's model year, 18000 is the purchase price, and 2018 is the current year, the output is: Car's information: Model year: 2011 Purchase price: \( \$ 18000 \) Current value: \( \$ 5770 \) Note: Printinfo0 should use two spaces for indentation. File is marked as read only Current file: main.cpp =