A Run class, that can keep some basic data for a given run. Implement this class in a file named run.cpp. It should have the following public member variables: • double t_start: the starting time of the run (in Unix timestamp format¹, in seconds); • double t_end: the end of the run (in Unix timestamp format, in seconds); • int duration: the duration of the run in seconds (excluding pauses); • double distance: the total distance covered in meters; • valarray t_data: an array with the equidistant (it = 1 sec) timestamp data ti, starting at t_data[0] = t_start; • valarray lat_data: an array of the same length as t_data, that holds a time series of data for the latitude lati; • valarray lon_data: an array of the same length as t_data, that holds a time series of data for the longitude lonį; It should also have the following member functions, which you should define: • a constructor that creates a new object of the Run class, with a double t_s as its only argument that it uses to initialize the starting time, and immediately calls another member function startRun() ⚫ three public functions, void startRun(), void pauseRun() and void endRun () which you can leave empty (assume that they are already written and will take care of filling in the data); a public function void printRunInfo() that prints out a structured message summarising the run; two public functions double get_avg_pace() and double get_fastest_pace (), that will return the average pace and the fastest pace of a run in units of min/km. Leave these empty; their implementation will be the main task of Question 2.c.

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter8: Advanced Method Concepts
Section: Chapter Questions
Problem 8RQ
Question
A Run class, that can keep some basic data for a given run. Implement this class
in a file named run.cpp. It should have the following public member variables:
• double t_start: the starting time of the run (in Unix timestamp format¹,
in seconds);
• double t_end: the end of the run (in Unix timestamp format, in seconds);
• int duration: the duration of the run in seconds (excluding pauses);
• double distance: the total distance covered in meters;
• valarray<double> t_data: an array with the equidistant (it = 1 sec)
timestamp data ti, starting at t_data[0] = t_start;
• valarray<double> lat_data: an array of the same length as t_data, that
holds a time series of data for the latitude lati;
• valarray<double> lon_data: an array of the same length as t_data, that
holds a time series of data for the longitude lonį;
It should also have the following member functions, which you should define:
• a constructor that creates a new object of the Run class, with a double t_s
as its only argument that it uses to initialize the starting time, and
immediately calls another member function startRun()
⚫ three public functions, void startRun(), void pauseRun() and
void endRun () which you can leave empty (assume that they are already
written and will take care of filling in the data);
a public function void printRunInfo() that prints out a structured
message summarising the run;
two public functions double get_avg_pace() and
double get_fastest_pace (), that will return the average pace and the
fastest pace of a run in units of min/km. Leave these empty; their
implementation will be the main task of Question 2.c.
Transcribed Image Text:A Run class, that can keep some basic data for a given run. Implement this class in a file named run.cpp. It should have the following public member variables: • double t_start: the starting time of the run (in Unix timestamp format¹, in seconds); • double t_end: the end of the run (in Unix timestamp format, in seconds); • int duration: the duration of the run in seconds (excluding pauses); • double distance: the total distance covered in meters; • valarray<double> t_data: an array with the equidistant (it = 1 sec) timestamp data ti, starting at t_data[0] = t_start; • valarray<double> lat_data: an array of the same length as t_data, that holds a time series of data for the latitude lati; • valarray<double> lon_data: an array of the same length as t_data, that holds a time series of data for the longitude lonį; It should also have the following member functions, which you should define: • a constructor that creates a new object of the Run class, with a double t_s as its only argument that it uses to initialize the starting time, and immediately calls another member function startRun() ⚫ three public functions, void startRun(), void pauseRun() and void endRun () which you can leave empty (assume that they are already written and will take care of filling in the data); a public function void printRunInfo() that prints out a structured message summarising the run; two public functions double get_avg_pace() and double get_fastest_pace (), that will return the average pace and the fastest pace of a run in units of min/km. Leave these empty; their implementation will be the main task of Question 2.c.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,