Answered step by step
Verified Expert Solution
Question
1 Approved Answer
how do i solve this without using arrays? Assignment: The client will provide data in the form of a text file. There are three numbers
how do i solve this without using arrays?
Assignment: The client will provide data in the form of a text file. There are three numbers on each line, separated by spaces. The numbers represent the number of calories consumed for breakfast, lunch and dinner, respectively. You should assume that the file includes data for exactly one week (i.e., seven lines of text representing seven days Monday to Sunday). Your program should read the data from the file, where each row keeps record of calories consumed for breakfast, lunch, and dinner. Your program should compute and print out the following information: The average number of calories consumed each day The average number of calories consumed in each of the three meals . Your program must not contain any array. Your program must read the data from a file named input.txt. You may assume that the file has exactly three numbers in each column and seven rows. Example content of an input file: 200.0 1000 800 450 845 1200 800 250 400.6 0 1500 1800 600 500 1000 700 1400 1700 675 400 900 Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started