Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

A person keeps a log of daily spending. Write a program SpendingReport.java that

ID: 3857046 • Letter: A

Question

A person keeps a log of daily spending. Write a program SpendingReport.java that reports the statics of the spending for a week. Ask user to enter daily spending within the week. (Day 1, Monday, through day 7, Sunday). Save the information in an array. Calculate the total and the average spending for the week. Count the total days where spending is higher than the average. Print out average, total, number of days higher than the average and the day of the week with highest spending. Sample output: Enter spending day 1 ($): 25 Enter spending day 2 ($): 16.5 Enter spending day 3 ($): 23.5 Enter spending day 4 ($): 12 Enter spending day 5 ($): 0 Enter spending day 6 ($): 42 Enter spending day 7 ($): 31 Total spending: $ Average: $21.43/day Number of days above average spending: 4 Highest spending day: Saturday

Explanation / Answer

Program is written below Cheers :) import java.util.*; public class Spend { public static void main(String args[]){ String[] strDays = new String[] { "Sunday", "Monday", "Tuesday","Wednesday", "Thurseday","Friday", "Saturday" }; Scanner in = new Scanner(System.in); double[] spends = new double[7]; for(int i=0;iavg){ days++; } } System.out.println("Number of days above average spending: " + days); System.out.println("highest spending day "+ (strDays[max])); } }
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote