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.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education