Redo or do for the first time programming project but this


Question: Redo or do for the first time Programming Project but this time use a loop to read the names from the file. Your program should also handle an arbitrary number of entries in the file instead of handling only three entries. To do this, your program must check to see if there is still data left to read (i.e., it has reached the end of the file).

Programming Project: (This is an extension of an exercise from Chapter 1.) A simple rule to estimate your ideal body weight is to allow 110 pounds for the first 5 feet of height and 5 pounds for each additional inch. Create the following text in a text file. It contains the names and heights in feet and inches of Tom Atto (6'3"), Eaton Wright (5'5"), and Cary Oki (5'11"):

Tom Atto

6

3

Eaton Wright

5

5

Cary Oki

5

11

Write a program that reads the data in the file and outputs the full name and ideal body weight for each person. In the next chapter, you will learn about loops, which allow for a more efficient way to solve this problem.

Solution Preview :

Prepared by a verified Expert
Basic Computer Science: Redo or do for the first time programming project but this
Reference No:- TGS02404345

Now Priced at $15 (50% Discount)

Recommended (93%)

Rated (4.5/5)