Question: this is in C++ Create a project named Assignment _5 . Save the file names-1.txt in the project. Then write a program in main.cpp, that

this is in C++

Create a project named Assignment _5 . Save the file names-1.txtthis is in C++ Create a project named Assignment _5 . Save in the project. Then write a program in main.cpp, that reads the data in names-1.txt file and outputs the full name and ideal body weight for each person on the screen. 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 four entries. You apply the formula only, if the persons height is 5 feet or more.

Ideal Body Weight Estimation: 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.

110 + ((heightInFeet - 5) * 12 + additionalInches ) * 5

For example, a person that 6 feet and 1 inches tall would be 110 + ((6-5) * 12 + 1 ) * 5

Sample run:

The ideal body weight for Tom Atto is 185 pounds.

The ideal body weight for Eaton Wright is 135 pounds.

The ideal body weight for Cary Oki is 165 pounds.

I can't calculate the ideal body weight for Omar Ahmed.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!