The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 4 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
C++ VERSION ANWER (NO JAVA VERSION)
Define a class to represent time. The class should provide the
following methods in the public user interface:
A constructor that takes one integer parameter, a time in minutes.
A constructor that takes two integer parameters, a number of hours
and a number of minutes.
A set method that takes one integer parameter, a time in minutes.
A set method that takes two integer parameters, a number of hours and
a number of minutes.
A getMinutes method that returns the time as all minutes.
A getWholeHours method that returns the number of whole hours.
A getHours method that returns the time in hours as a double.
A getRemainingMinutes that returns the number of minutes after
accounting for the whole hours. For example, it time t represents 135
minutes, then t.getMinutes() is 135, t.getWholeHours() is 2,
t.getRemainingMinutes() is 15 and t.getHours() is 1.25
An add method that returns the calling time plus the parameter time.
A sub method that returns the calling time minus the parameter time.
For example, if t1 represents 30 minutes and t2 represents 15 minutes
then t1.add(t2) returns a time object representing 4 minutes.
A getMilTime method that takes two reference parameters, hours and
minutes, and stores in the parameters the hours and minutes of the
time on a 24 hour military clock. If t represents 75 minutes, then
t.getMilTime(h, m) should store 1 in h and 15 in m.
A getCivTime method that takes three reference parameters, hours,
minutes, and a char ampm and stores in the parameters the hours and
minutes of the time on a 12 hour civilian clock and stores in the
ampm parameter 'a' for am and 'p' for pm. If t represents 75 minutes,
then t.getCivTime(h, m, ap) should store 1 in h, 15 in m, and 'a' in
ap.
Write a main program that creates several time objects and tests the
various class methods. Hand in a printout of the source code and
output from a test run.
Hel-----------lo -----------Sir-----------/Ma-----------dam----------- Â----------- Th-----------ank----------- Yo-----------u f-----------or -----------usi-----------ng -----------our----------- we-----------bsi-----------te -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill-----------