Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

using C++ We would like to develop class expenditure to be used to find the total expenditures for a number of families. The class has

image text in transcribed

using C++

We would like to develop class expenditure to be used to find the total expenditures for a number of families. The class has data members name (of type string), the data members of type int: utilities, food, personal, subTetal, 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 parameterized constructor with default values "Al-Mullah", 800, 2400, and 1200. A destructor, and a print() function to write all the details of an expenditure object. The class has a member function getCount() to return count, a member function getTotalExpendituces) to return total expenditures. The destructor should print the values of count and totalExpenditure, Write the definition of the class expenditure in the file expenditureh 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 F1, F2, F3, F4, F5, F6, F7 with default values // print the name and subTotal of each family Il print the count and totalExpenditures // read from the text file expenditure.txt the following data assuming that the number of lines is not known Al-Mullah 700 2800 1600 Al-Issa 800 3100 1400 Al-Rooms 650 3007 1800 Al-Shebani 910 2140 1100 Al-Kurdi 540 2440 1900 Al-Ali 720 2800 1200 Al-Walled 940 1700 1300 Il print the count and totalExpenditures Use const whenever needed to enforce the principle of least 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

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Driven Web Sites

Authors: Joline Morrison, Mike Morrison

2nd Edition

? 061906448X, 978-0619064488

Students also viewed these Databases questions