Question
Write a function definition for the following situation: a) Function inputItem( ) to read and store items name that get from user. b) Function totalPerItems
Write a function definition for the following situation: a) Function inputItem( ) to read and store items name that get from user. b) Function totalPerItems ( ) to calculate and display the total expenditure for each item that received two parameter which are array budget and array item. c) Function totalMay ( ) to calculate and returns the total expenditure for May that receives two parameter which are array budget and array month. d) Write the main function that will do the following task: i. Declares the two-dimensional array named budget and initialized it with the value given in table above. ii. Declare the array named item. iii. Declare the array named month and initialized it with the value month in table above. iv. Call the above functions.
int main() \{ const int ITEM =5; const int MONTH =6; double budget[ITEM][MONTH]; // value must be initialized and the value of budget based on the table below string item[ITEM]; //value from user string month[MONTH]; //value must be initialized This budget array stores a six month budget for individual items. Each row of the array corresponds to a particular budgeted item like rent, electric, water, internet and cleaner. Each column of the array corresponds to six month from January until June. Table below shows the sample input data for above array
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started