Absolute C++
Absolute C++
6th Edition
ISBN: 9780133970784
Author: Walter Savitch, Kenrick Mock
Publisher: Addison-Wesley
bartleby

Videos

Textbook Question
Book Icon
Chapter 2, Problem 11PP

(This is an extension of an exercise from Chapter I.) 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 Eaton Wright ( 5 ' 5 " ) , and Cary Oki ( 5 ' 11 " ) :

( 6 ' 3 " ) ,

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. 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.

Blurred answer
Students have asked these similar questions
help
O kgeme: ot Co htioseeningodmataorkconlaundh Readng r Excel File I/O The attached Distances xlsx file contains a spreadsheet with the pairwise distances in mies of the top 100 US cities by population. A preview of the spreadsheet is shown below. The first row and first column contain the city names using the following format: city name comma space capitalized state abbreviation, e.g, Nashville, TN. Note that the very first cell of the spresheet, A1, is blank. Write a function called get_distance that accepts two character vector inputs representing the names of two cities. The functian returns the distance between them as an output argument called distance. For example, the cali get_distance('Seattle, WA', Miami, FL') should return 3723. If one ar both of the specified cities are not in the file, the function returns 1. Your function should load the data only once. File VO is a time consuming operation. Loading the date multiple times is will likely cause a time-out error when…
In the input file (see image), grades are listed for the geography tests of group 2b. There have been three tests of which the grades will be included in the half-yearly report that is given to the students before the Christmas break. On each line of the input you can find the name of the student, followed by one or more under scores (’_’). These are succeeded by the grades for the tests, for example: Anne Adema____________6.5 5.5 4.5Bea de Bruin__________6.7 7.2 7.7Chris Cohen___________6.8 7.8 7.3Dirk Dirksen__________1.0 5.0 7.7 The lowest grade possible is a 1, the highest a 10. If somebody missed a test, the grade on the list is a 1. The assignment is to make the report for the geography course of group 2b, which should look like this: Report for group 2bAnne Adema has an average grade of 5.5Bea de Bruin has an average grade of 7.2Chris Cohen has an average grade of 7.3Dirk Dirksen has an average grade of 4.6End of report Use functions to structure the code in Python.

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
  • Text book image
    EBK JAVA PROGRAMMING
    Computer Science
    ISBN:9781337671385
    Author:FARRELL
    Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
C - File I/O; Author: Tutorials Point (India) Ltd.;https://www.youtube.com/watch?v=cEfuwpbGi1k;License: Standard YouTube License, CC-BY
file handling functions in c | fprintf, fscanf, fread, fwrite |; Author: Education 4u;https://www.youtube.com/watch?v=aqeXS1bJihA;License: Standard Youtube License