Question: In Java Background: A nutritionist has contracted you to create a software that will help clients count calories consumed Assignment (Part 1: 75 points): The
Background: A nutritionist has contracted you to create a software that will help clients count calories consumed Assignment (Part 1: 75 points): The client will provide data in the form of a text file. Each line will contain three numbers separated by spaces. The numbers represent the number of calories consumed for breakfast, lunch and dinner, respectively. You may assume that the file includes data for exactly one week (i.e., seven lines represent seven days Monday to Sunday). Your program should read the data from the file into a 2-dimensional array that has seven rows and three columns, where each row will keep record of calories consumed for all the three meals of a day. Then, compute and print out the following information a list of the total number of calories consumed each day from Monday to Sunday the average number of calories consumed each day the average number of calories (average over the week) consumed in each of the meals the maximum number of calories consumed each day . the maximum number of calories consumed in each meal type Your program must have separate methods for reading in the data and for printing each of the different quantities given above. Please do not just put all of your code into the main method Example input file: Your program must read the input from a file named inputl.txt 200 1000 800 450 845 1200 800 250 400 0 1500 1800 600 500 1000 700 1400 1700 675 400 900
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
