Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started