Question: c++ please We would like to develop class expenditure to be used to find the total expenditures for a number of families. The class has
c++ pleaseWe would like to develop class expenditure to be used to find the total expenditures for a number of families. The class has data members nume (of type string), the data members of type intilities, food, personal, smb Total, static data members count to keep track of the total number of family objects instantiated from class expenditure), and TotalExpenditure to keep track of the total expenditures of all families represented by all declared objects). The class expenditure also has any needed set and get member functions, a parametriced constructor with default values "Al-Mullah", 800, 2400 and 1200. A destructor, and a primi function to write all the details of an expenditure object. The class has a member function gerCountto return count, a member function getTotalExpenditures to return total expenditures. The destructor should print the values of count and totalExpenditure Write the definition of the class expenditure in the file expedie Implement the member functions of the class in the file expenditureImp.cpp. Write a test driver main() in the file expenditure.cpp that does the following declare A as an array of 7 expenditure objects Fl. F2, F3, F4, F5, F6, F7 with default values print the name and sub Total of each family / print the count and totalExpenditures // read from the text file expenditure, the following data assuming that the number of lines is not known Al-Mallah 700 2800 1600 Al-Issa 800 31001400 Al-Room 650 3007 1800 Al-Shabani 910 2140 1100 Al-Kurdi 540 2400 1900 Al-Ali 720 2800 1200 Al-Walled 940 1700 1300 print the count and totalExpenditures : Use const whenever needed to enforce the principle of leat privilege Sample Output might look like the following: Al-Mullah expenditure is 4400 Al-Mullah expenditure is: 4400 Al-Mullah expenditure is 4400 Al-Mullah expenditure is: 4400 Al-Mullah expenditure is 4400 Al-Mullah expenditure is: 4400 Al-Mullah expenditure is: 4400 Number of families is: 7 and total expenditure is: 30000 Al-Mullah expenditure is 5100 Al-Issa expenditure is: 5300 Al-Roome expenditure is: 5457 Al-Shchani expenditure is: 4150 Al-Kundi expenditure is: 4880 Al-Aliexpenditure is: 4720 Al-Walled expenditure is: 3940 Number of families is: 7 and total expenditure is: 33547 Total number of families is: 6 and total expenditure is: 29607 Total number of families is: 5 and total expenditure is: 24887 Total number of families is 4 and total expenditure is 20007 Total number of families is 3 and total expenditure is: 15857 Total number of families is 2 and total expenditure is: 10400 Total number of families is. I and total expenditure is: 5100 Total number of families is: and total expenditure is 2/2
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
