Question: Write the .cpp for these classes. Sample of Output.txt 3- Electronics class: This class will inherit everything in Product class. Will add one more member
Write the .cpp for these classes.


Sample of "Output.txt"

3- Electronics class: This class will inherit everything in Product class. Will add one more member variable warranty' of type int Constructor Getters and Setters A method called ReadData0. It takes an istream passed by reference as its only parameter. It reads in an integer (barcode), name, and price. This method returns a boolean value: true if all data was read successfully, false otherwise. Use this member function to read data from the second file ("Electronics txt') A 9% tax will be added to all electronics Redefine u function. This function will check the price of item and select one of the following options: o If the price of the item is less than 200, then the item will have warranty for 1 year and there is no financing option available o If the price is 200-1000, then the item will have a warranty for 3 years, and it can either be bought in cash or it has a financing option to be paid over 12 months with a 1% compound annual interest of the price after tax. o Otherwise, the item will have 5 years warranty and it can either be bought in cash or it has a financing option to be paid over 24 months with a 1% compound annual interest of the price after tax. o A (p)(1+r)n number of monthes/12 Where n is 12 o This function will output to "Output.txt" years of warranty, total price after adding taxes on items and options of payment. 3- Electronics class: This class will inherit everything in Product class. Will add one more member variable warranty' of type int Constructor Getters and Setters A method called ReadData0. It takes an istream passed by reference as its only parameter. It reads in an integer (barcode), name, and price. This method returns a boolean value: true if all data was read successfully, false otherwise. Use this member function to read data from the second file ("Electronics txt') A 9% tax will be added to all electronics Redefine u function. This function will check the price of item and select one of the following options: o If the price of the item is less than 200, then the item will have warranty for 1 year and there is no financing option available o If the price is 200-1000, then the item will have a warranty for 3 years, and it can either be bought in cash or it has a financing option to be paid over 12 months with a 1% compound annual interest of the price after tax. o Otherwise, the item will have 5 years warranty and it can either be bought in cash or it has a financing option to be paid over 24 months with a 1% compound annual interest of the price after tax. o A (p)(1+r)n number of monthes/12 Where n is 12 o This function will output to "Output.txt" years of warranty, total price after adding taxes on items and options of payment
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
