Answered step by step
Verified Expert Solution
Link Copied!

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?
image text in transcribed
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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions

Question

Have you accurately defined the problem?

Answered: 1 week ago

Question

Were all members comfortable brainstorming in front of each other?

Answered: 1 week ago

Question

4. What will the team agreement contain?

Answered: 1 week ago