Question: /** * Write a complete Java program to compute the total living cost for a semester at college. * The main method calls three methods
/** * Write a complete Java program to compute the total living cost for a semester at college. * The main method calls three methods to do this: 1. getTotalWeeks: requests from the user the total number of weeks they will attend college * and returns this number as an integer. 2. getDailyExpenses: requests from the user the estimated daily living expenses for each day * of the week (seven values) and returns these as an array of doubles. 3. computeLivingExpenses: takes as parameters the total number of weeks * (the integer value returned from the first method) and the estimated * daily expenses (array of seven doubles returned from the second method) and * returns a double representing the estimated total living expenses for the semester. * To compute the total living expenses, use a for loop to first compute the total weekly living expenses * then multiply this number by the total number of weeks the student will be in college. * */
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
