Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Fall 2018 and string libraries Implement the class Tiktok discussed below. You may assume both lostream a included, you may not use any other libraries.

image text in transcribed
image text in transcribed
Fall 2018 and string libraries Implement the class Tiktok discussed below. You may assume both lostream a included, you may not use any other libraries. There are 60 seconds in a minute 60 minutes in an hour. The 24-hour clock convention goes from 0:0:0 to 23:59.59. R starting that way you get a better sense on what member variables you need and how you wan implement the member functions. Problem 2: before a minute, 3600 seconds in an hour It may be useful to recall that the modulus operator "%" can be used to obtain the remainder of integer division, also the operator may be used to concatenate strings, and the function std:to_stringittk n integer and returns the string equivalent of that integer, presumably for concatenating a string teger with an Implement the default constructor which sets the initial state of Tiktok to correspond to time 0:00:00 in 24-hour clock convention (or 12:00:00 AM 12-hour clock convention). addSeconds adds the number of seconds passed into the function to Tiktok. If the amount of seconds to add is negative do nothing. There is no upper limit to the amount of seconds that can be added addMinutes adds the number of minutes passed into the function to Tiktok. If the amount of minutes to add is negative do nothing. There is no upper limit to the amount of minutes that can be added addHours adds the number of hours passed into the function to Tiktok. If the amount of hours t add is negative do nothing. There is no upper limit to the amount of hours that can be added. display24 prints to the console the time stored in Tiktok using 24-hour convention; with the following format:xX:Xx:Xx, followed by a newline display12 prints to the console the time stored in Tiktok using 12-hour convention. It will print AM or PM appropriately; with the following format XX:Xx:xXx XM, followed by a newline elow is the class definition for Tiktok, presumably in some header file. After planning out your design eclare your member variables in the private field of the class. class Tiktok public: Tiktok); void addSeconds(int s); void addMinutes (int m); void addHours (int h); void display24() const void display12() const private: //TODO: Declare any member variables you think you will need

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

Database Administration The Complete Guide To Dba Practices And Procedures

Authors: Craig S. Mullins

2nd Edition

0321822943, 978-0321822949

More Books

Students also viewed these Databases questions