Question: using c++ Define a class called Machine which represents any electrical machine. Write a driver program to test your class (make sure to test all

using c++
Define a class called Machine which represents any electrical machine. Write a driver program to test your class (make sure to test all member functions inside your class). Your class contains the following private data members: - Double variable which represents the price of the machine. - Integer variable which contains the model year of the machine. * - Array of strings of size equal to 3 the country of origin of this machine, brand name of the machine, and the owner name of the machine. Provide public member functions for each of the following: t a) A constructor function that enables an object of this class to be initialized when it is declared. * b) A destructor function that at first decrements the price by 10 and then prints the statement "Hi" on the screen along with the new price. c) set and get functions for all private data members. For the price make sure to check that the user has given +ve values, and for the year check that he has given a value greater than 1990. Otherwise, display an error message that invalid values has been entered and reset them to some default values. d) Function called Info which displays all the information, i.e. data members values related to any Machine object. e) Friend function called CostLoss which returns the amount of price loss of the machine, which is equal 0.5 current price multiplied by the number of years from its model year till now
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
