Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C++. Requires classes and dynamic arrays. Full instructions in the images below. 1 - Objective Construction of a class with various features, paired with the

C++. Requires classes and dynamic arrays. Full instructions in the images below.

image text in transcribedimage text in transcribedimage text in transcribed

1 - Objective Construction of a class with various features, paired with the use of a dynamic array. 2 - Problem For this assignment, you will need to turn in 3 files: main.cpp, class.h, and class.cpp. These should be turned in via the server in the same directory named hw4. Your hw4 directory will be copied at 11:59 PM the night the assignment is due. Anything not in the directory at that time will not be accepted 2.1 - Class You will need to make a class named stopwatch with the attributes hour, minute, and second. You need to declare them as private members. Your class will need to contain two constructors, a default that wil set the classes attributes to 0, and a constructor that takes three arguments to set hour, minute and second. 2.2 - Main Program Your main program should ask the user how many times they wish to enter and then create a dynamic array based on that input. The user should then be asked to enter the data for the time objects that will be stored in the array. If the user enters a value outside of the ranges for one or more of the attributes (i.e., negative for hours, negative or 60 values for minutes or seconds), the default constructor should be called. Once the array has been completed, the user should be presented with a menu with three options: 1) Print the Individual Stored Times, 2) Print the Total Time, 3) Exit the Program. In order to perform the first two menu functions you may need to expand your class beyond the earlier mentioned constructors. Specifically, to implement 1), add a new member function, called print_time) to print out the time in the format of hh:mm:ss (see the following example output for a demonstration). To implement 2), you need to implement a loop to go over all objects in your dynamic array and sum their

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

Handbook Of Relational Database Design

Authors: Candace C. Fleming, Barbara Von Halle

1st Edition

0201114348, 978-0201114348

More Books

Students also viewed these Databases questions