C++ Programming: From Problem Analysis to Program Design
C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN: 9781337102087
Author: D. S. Malik
Publisher: Cengage Learning
Question
Book Icon
Chapter 8, Problem 12PE
Program Plan Intro

Program Plan:

  • Include the header files as per code requirement.
  • Define the function read_data() having required parameters such as an array of string to store player names, a 2D array of doubles to store miles run by each player on each day of the week and an integer is defined to store number of players or number of rows.
  • Declare and initialize required constant variables to store number of players and number of days in a week which will be number of rows and columns of the 2D array to store the number of miles run each day of a week by each player.
  • Get the player’s name and store it into the array player_Names at current index.
  • Define the function compute_average() to compute the average of miles.
  • Define the function disp_average () to display the average of miles
  • Print the player’s name from the array player_Names, total miles and average miles each day from array total_n_avg_miles.
  • Declare required arrays to store player names, number of miles run each day by each player, and total miles and average miles run each day.
  • Call the main function and call all three methods.
  • Display the output on console.

Program Description:

The main purpose of the program is to read the data from the input file and compute the total miles run by each runner and average number of miles run each day and display the names of runner along with their toal miles and average number of miles.

Blurred answer
Students have asked these similar questions
Q2/find the transfer function C/R for the system shown in the figure Re ད
Please original work select a topic related to architectures or infrastructures (Data Lakehouse Architecture). Discussing how you would implement your chosen topic in a data warehouse project Please cite in text references and add weblinks
Please original work What topic would be related to architectures or infrastructures. How you would implement your chosen topic in a data warehouse project. Please cite in text references and add weblinks
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT