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
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 k(th) week. Assume that the maximum number of weeks tracked is 250.
Add the following functions to your program:
-
A function that finds the total of all expenses incurred since week t for a given t.
-
A function that records the total expenses and revenues for the next unrecorded week. It must check if there is still space in the array.
-
A function that prints the number of weeks recorded
-
A function that prints all revenues and expenses recorded
-
A function that returns a pointer to the largest revenue recorded
Organize the program so the function prototypes are presented
first, and the definitions after the main
function. Your program should keep asking the user to select
one of the following options and execute
the corresponding function based on the user choice:
(A)
computed 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.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
