Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Use the following specification to code a complete C++ module named Activity : enum class ActivityType { Lecture, Homework, Research, Presentation, Study }; Basic Details

Use the following specification to code a complete C++ module named Activity:

enum class ActivityType { Lecture, Homework, Research, Presentation, Study }; 

Basic Details

Your Activity class includes at least the following data-members:

the address of a C-style null-terminated string of client-specified length that holds the description of the activity (composition relationship).

Valid Description: any string with at least 3 characters.

the type of activity using one of the enumeration constants defined above, defaulting to Lecture.

Public Member Functions

  • Default constructor;

A custom constructor that receives as parameters:

  • the type of activity (optional);
  • the address of a C-style null-terminated string containing the activity description.

A function named activityTimeDuration.

If the current object is not in an empty state, this function calculates the activity time duration according to the following rules:

  • Lecture activity has a duration of one hour and 40 minutes,
  • Homework activity has a duration of 5 days,
  • Research activity has a duration of two hours and 30 minutes,
  • Presentation activity has a duration of 30 minutes,
  • Study activity has a duration of three hours,

A class function named totalNoOfActivity that returns the number of Activity objects that currently exist and have not yet been destroyed.

Other Features

Include in your design all special member functions required to manage your objects.

You are allowed to add as many private members as you see fit.

Your design should not generate any memory leaks, should meet the C++17 standard and should apply best practices.

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions

Question

How was the information collected?

Answered: 1 week ago

Question

Question 12 options:

Answered: 1 week ago

Question

What were the causes of the Industrial Revolution in England ?

Answered: 1 week ago

Question

QUESTION:- Hypertension- drugs, normal values?

Answered: 1 week ago