題目:

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.

Creat 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 wight for each person.

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.

【program】:

 

題目來源:Absolute C++,Sixth Edition,Walter Savitch,Page 126,第11題

此文僅學習用,並無商業行為,如有侵權告知後立即刪除

arrow
arrow
    文章標籤
    檔案讀取 C++ OOP
    全站熱搜
    創作者介紹
    創作者 Mark Zhang 的頭像
    Mark Zhang

    讀處

    Mark Zhang 發表在 痞客邦 留言(0) 人氣()