b. Assign a group leader for problem 2. __________________________________ c. Us
ID: 3625698 • Letter: B
Question
b. Assign a group leader for problem 2. __________________________________
c. Use the function scan_members() that you wrote earlier.
g. Write a function find_i_max() that returns the index of the member that has
the highest account balance. The function proto-type is below:
int find_imax(double balance[], int i_init, int i_end);
d. In the array, swap the member with the highest balance with the first person in the
array. You will need to swap all three components, the first name, the last name,
and the balance.
e. Write and call a function comp_total() that returns the total unpaid balance
for all members. Write the function proto-type below:
___________________________________________________________________
f. In main(), open an output file hw14.out to create the following report.
Convert the output to a whole line using sprintf() before writing to the file.
(For debugging purposes, you may want to echo-print this on the screen, as well.)
Note that only information for members that owe money is displayed.
Cartoon Club Delinquent Members Report
Name Unpaid Balance
------------------------------------------
Roger Rabbit $ 122.00
Mary Poppins $ 0.20
Mickey Mouse $ 25.75
Goofy Goof $ 116.00
...
Mr. Incredible $ 19.26
$ xxxx.xx total unpaid balance
Explanation / Answer
Dear, Not clear with the data may related prvious assignment able to help you with only one part g) int find_imax(double balance[], int i_init, int i_end) { int i=i_init; int max=0; double maxval=balance[0]; for(int i=1;i<i_end;i++) { if(maxval<balance[i]) { maxval=balance[i]; max=i; } int i=i_init; int max=0; double maxval=balance[0]; for(int i=1;i<i_end;i++) { if(maxval<balance[i]) { maxval=balance[i]; max=i; } } return max; return max; }e)
double comp_total(double balance[], int i_init, int i_end) { double total=0 for(int i=0;i<i_end;i++) sum+=balance[i]; return balance; } Hope this will help you return balance; } Hope this will help you
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.