Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In c + + Assignment: Imagine you are tasked with developing a component of a fitness tracking system. This system tracks different exercises a user

In c++
Assignment: Imagine you are tasked with developing a component of a fitness tracking system. This system tracks different exercises a user performs, such as running, swimming, or cycling, including details like the duration of the exercise and the distance covered. Each exercise entry is unique with its specifics, but the system also needs to keep track of the total amount of exercise done across all entries. Your objective is to create an ExerciseEntry class that encapsulates this functionality. The class should have instance member variables for the type of exercise, duration, and rate of perceived exertion (RPE). Additionally, it should include a static member variable to keep track of the total exercise duration for all entries and member functions to display an entry's details and retrieve the total exercise duration.
Declare a class named ExerciseEntry.
Inside the class, declare instance member variables for exerciseType (type string), durationMinutes (type int), and intensityLevel (type int) to represent the RPE.
Declare a static member variable named totalDurationMinutes to track the total exercise duration across all instances of the ExerciseEntry class.
Write a constructor for the ExerciseEntry class that accepts arguments for each instance member variable and initializes them. The constructor should also add the current entry's duration to the totalDurationMinutes static member variable.
Implement an instance member function named displayDetails to print the exercise type, duration, and intensity level.
Implement a static member function named getTotalDurationMinutes to return the total exercise duration for all entries.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning VB.NET Databases

Authors: Thearon Willis

1st Edition

1594864217, 978-1594864216

More Books

Students also viewed these Databases questions

Question

What is a path-dependent cash flow security?

Answered: 1 week ago