Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please help me with the following C++ problem and a text file name ch8_Ex12Data.txt with the following info, the expected outcome should look like this
Please help me with the following C++ problem
and a text file name ch8_Ex12Data.txt with the following info,
the expected outcome should look like this
Thank you.
Write a program to help them analyze their data. Your program must contain parallel arrays: an array to store the names of the runners and a two-dimensional array of five rows and seven columns to store the number of miles run by each runner each day. Furthermore, your program must contain at least the following functions: - a function to read and store the runners' names and the numbers of miles run each day; - a function to calculate the average number of miles run each day; - and a function to output the results. (You may assume that the input data is stored in a file and each line of data is in the following form: runnerName milesDay 1 milesDay 2 milesDay 3 milesDay4 milesDay5 milesDay6 milesDay7.) \begin{tabular}{l|l|lllllll} ch8_Ex12Data.txt & & \multicolumn{4}{c}{ main.cpp } \\ \hline 1 & Jason & 10 & 15 & 20 & 25 & 18 & 20 & 26 \\ 2 & Samantha & 15 & 18 & 29 & 16 & 26 & 20 & 23 \\ 3 & Ravi & 20 & 26 & 18 & 29 & 10 & 12 & 20 \\ 4 & Sheila & 17 & 20 & 15 & 26 & 18 & 25 & 12 \\ 5 & Ankit & 16 & 8 & 28 & 20 & 11 & 25 & 21 \end{tabular} Expected Output (3) Name Day 1 Day 2 Day 3 Day 4 Day 5 Jason 10.00 15.00 20.00 25.00 18.00 20.0 Ravi 20.0026.0018.0029.0010.0012.0
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started