Question
Programming in C Question Financial Records Create a program to store weekly expenses and revenues over a period of time. The program should store the
Programming in C Question
Financial Records
Create a program to store weekly expenses and revenues over a period of time. The program should store the expenses and revenues in two global array variables. Values stored in the array at index k represent the total revenues/expenses recorded during the kth week. Assume that the maximum number of weeks tracked is 250.
Add the following functions to your program: 1. A function printOptions that prints all the options for the user to choose from
2. A function expensesStartingAt that finds the total of all expenses incurred since week t for a given t
3. A function recordWeekData that records the total expenses and revenues for the next unrecorded week. It must check if there is still space in the array and if not, print The array is full.
4. A function printNumberOfWeeks that prints the number of weeks recorded
5. A function printAllData that prints all revenues and expenses recorded
6. A function largestRevenue that returns a pointer to the largest revenue recorded
Organize the program so the function declarations are presented first before the main function, and the function definitions after the main function. Your program should keep asking the user to select one of the following options A through F and execute the corresponding function based on the user choice:
A: compute the total of all expenses,
B: add a new expense/revenue, C: print the number of weeks recorded, D: print all revenues and expenses recorded,
E: print the largest revenue recorded, or F: exit the program.
Call your program fincance.c. Compile and test your program.
Make sure your code is properly indented, your variables have meaningful names, and macro definitions are used when appropriate.
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