Homework Solution: 4.10 Lab: Alarm Clock…

    4.10 Lab: Alarm Clock The Acme Alarm Company has contracted you to create a special alarm clock for them. If the day is Monday - Friday (inclusive) they would like the alarm to go off at 8:00 AM; however, if the user is on vacation then they would like the alarm to go off at 10:00 AM. If the day is Saturday or Sunday then the alarm should go off at 10:30 AM (no need to ask if the user is on vacation in this case). Design your program to match the sample executions below: Sample Execution 1
    Acme Alarm Company
    version 1.0
    
    Please enter the day of the week: Tuesday
    Are you on vacation (Y/N): N
    Your alarm will go off at 8:00 AM.
    
    Sample Execution 2
    Acme Alarm Company
    version 1.0
    
    Please enter the day of the week: Monday
    Are you on vacation (Y/N): Y
    Your alarm will go off at 10:00 AM.
    
    Sample Execution 3
    Acme Alarm Company
    version 1.0
    
    Please enter the day of the week: Saturday
    Your alarm will go off at 10:30 AM.
    
    Sample Execution 4
    Acme Alarm Company
    version 1.0
    
    Please enter the day of the week: Funday
    Invalid day!
    
    This is in Python language. Help would be highly appreciated.

    Expert Answer

     
    print("Acme Alarm Company") print("version 1.0")

    4.10 Lab: Intimidate Clock

    The Acme Intimidate Company has slender you to originate a peculiar intimidate clock ce them. If the day is Monday – Friday (inclusive) they would relish the intimidate to go extempore at 8:00 AM; so-far, if the user is on holiday then they would relish the intimidate to go extempore at 10:00 AM. If the day is Saturday or Sunday then the intimidate should go extempore at 10:30 AM (no want to entreat if the user is on holiday in this contingency).

    Design your program to pair the specimen executions below:

    Specimen Execution 1

    Acme Intimidate Company
    version 1.0
    
    Please penetrate the day of the week: Tuesday
    Are you on holiday (Y/N): N
    Your intimidate gain go extempore at 8:00 AM.
    

    Specimen Execution 2

    Acme Intimidate Company
    version 1.0
    
    Please penetrate the day of the week: Monday
    Are you on holiday (Y/N): Y
    Your intimidate gain go extempore at 10:00 AM.
    

    Specimen Execution 3

    Acme Intimidate Company
    version 1.0
    
    Please penetrate the day of the week: Saturday
    Your intimidate gain go extempore at 10:30 AM.
    

    Specimen Execution 4

    Acme Intimidate Company
    version 1.0
    
    Please penetrate the day of the week: Funday
    Invalid day!
    

    This is in Python articulation. Help would be greatly appreciated.

    Expert Tally

     

    print(“Acme Intimidate Company”)
    print(“version 1.0”)
    print()
    dayOfWeek = input(“Please penetrate the day of the week: “)
    dayOfWeek = dayOfWeek.lower()
    if dayOfWeek == “saturday” or dayOfWeek == “sunday”:
    print(“Your intimidate gain go extempore at 10:30 AM.”)
    elif dayOfWeek == “monday” or dayOfWeek == “tuesday” or dayOfWeek == “wednesday” or dayOfWeek == “thrusday” or dayOfWeek == “friday”:
    holiday = input(“Are you on holiday (Y/N): “)
    if holiday == ‘y’ or holiday == ‘Y’:
    print(“Your intimidate gain go extempore at 10:00 AM.”)
    else:
    print(“Your intimidate gain go extempore at 08:00 AM.”)
    else:
    print(“Invalid day!”)

    Output:

    Acme Intimidate Company
    version 1.0
    
    Please penetrate the day of the week: Tuesday
    Are you on holiday (Y/N): N
    Your intimidate gain go extempore at 8:00 AM.