Question: c + + Display the Clocks This function takes in three parameters, h , m , and s , which represent the hours ( 0
c Display the Clocks
This function takes in three parameters, h m and s which represent the hours minutes and seconds of the current time, respectively.
You can assume that you have access to the following functions:
nCharStringn c: Returns a string of n characters, where each character is c
formatTimeh m s: Returns the formatted time in hour clock format, given the current time in hours, minutes, and seconds.
formatTimeh m s: Returns the formatted time in hour clock format, given the current time in hours, minutes, and seconds.
To complete this function, follow the comments provided:
Print a line consisting of stars, spaces, and another stars.
Print a line consisting of star, spaces, HOUR CLOCK", spaces, another star, and spaces.
Print a line consisting of star, spaces, HOUR CLOCK", spaces, another star, and a line break.
Print a blank line.
Print a line consisting of star, spaces, the formatted time in hour clock format, spaces, another star, and spaces.
Print a line consisting of star, spaces, the formatted time in hour clock format, spaces, another star, and a line break.
Print a line consisting of stars, spaces, and another stars.
Here's the function signature for reference:
void displayClocksunsigned int h unsigned int m unsigned int s
TODO: Your code here, follow the comments for each line
Solution
Language: cpp
Display the clocks
@param h hours to
@param m minutes to
@param s seconds to
void displayClocksunsigned int h unsigned int m unsigned int s
The code in your submitted program may vary. For now, please get this to work with the given
function signature.
You may assume you have a working nCharString and formatTime and formatTime and has been imported
nCharString gives a string of stars. nCharString gives spaces
formatTimeh m s and formatTimeh m s give the formatted time as specified in the assignment
test will pass in
TODO: Your code here, follow the comments for each line
cout stars spaces stars endl
cout star spaces HOUR CLOCK spaces star spaces
cout star spaces HOUR CLOCK spaces star endl
cout an endl for a blank line
cout star spaces formatTimeh m s spaces star spaces
cout star spaces formatTimeh m s spaces star endl
cout stars spaces stars endl
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
