Use the function design recipe to develop a function named alarm_clock. The function has two parameters. The first parameter is named day and encodes the day of the week: 0=Sun, 1=Mon, 2=Tue, ..., 6-Sat. The second parameter is named vacation, and is True if we are on vacation. The function returns a string of the form "hour:00" that indicates when the alarm will ring. On weekdays, the string should be "7:00", but on the weekend, the string should be "10:00". If we are on vacation, then on weekdays the string should be "10:00", but on the weekend the string should be "off".
Use the function design recipe to develop a function named alarm_clock. The function has two parameters. The first parameter is named day and encodes the day of the week: 0=Sun, 1=Mon, 2=Tue, ..., 6-Sat. The second parameter is named vacation, and is True if we are on vacation. The function returns a string of the form "hour:00" that indicates when the alarm will ring. On weekdays, the string should be "7:00", but on the weekend, the string should be "10:00". If we are on vacation, then on weekdays the string should be "10:00", but on the weekend the string should be "off".
C++ for Engineers and Scientists
4th Edition
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Bronson, Gary J.
Chapter11: Introduction To Classes
Section11.4: A Case Study: Constructing A Date Class
Problem 7E
Related questions
Question
Please complete the exercise following the instructions. Thank you!
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 4 steps with 2 images
Knowledge Booster
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.Recommended textbooks for you
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning