Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Create a program that generates a simple day schedule with 3 activities, based u

ID: 3847276 • Letter: C

Question

Create a program that generates a simple day schedule with 3 activities, based upon the following inputs:

Activity Name (Keep it to a short word if you are using tabs, or in the length range using a .format() or .printf() statement)

Activity Starting Hour (in military time, which is a 24 hr clock, acceptable numbers 1-24 – do data validation)

Activity Ending Hour (in military time also) – perform a validity check to be sure that this number is greater than or equal to Starting Hour

Hints:  

Activities do not have to be entered in chronological order, but there should be no overlapping. Start/End numbers are inclusive.

Utilize a nested loop, the outer loop goes from 1..24 for the hour of day.

For each iteration of the outer loop, have an inner for() loop that goes from col=1 to col=3

Use a switch statement to test for the case of 1, 2, and 3 to represent each of 3 cols/activities. Then, under the case, use an if statement to test if the hour falls between the start/end time for this activity. Then perform the output of the activity into the appropriate column (tabs work here, or you can use the .printf() or .format() method, which is preferred. If using tabs, you can tab out when processing activity 1 - two tabs, activity 2 - three tabs, and activity 3 - four tabs, for example.

Perform data validation to prevent bad input.

This program requires at least 3 variables for each of the 3 activities you are logging, and 2 loop counter variables.

Arrays are not necessary, but if you want to use them you may.

Sample Output:

Enter activity 1 name: Eat

Enter activity 1 starting hour: 12

Enter activity 1 ending hour: 14

Enter activity 2 name: Sleep

Enter activity 2 starting hour: 1

Enter activity 2 ending hour: 9

Enter activity 3 name: School

Enter activity 3 starting hour: 16

Enter activity 3 ending hour: 22

My Schedule

Hour     Act1      Act2      Act3

1                      Sleep

2                      Sleep

3                      Sleep

4                      Sleep

5                      Sleep

6                      Sleep

7                      Sleep

8                      Sleep

9                      Sleep

10

11

12         Eat

13         Eat

14         Eat

15

16                                 School

17                                 School

18                                 School

19                                 School

20                                 School

21                                 School

22                                 School

23

24

Explanation / Answer

.schedule-rows td { width: 80px; height: 30px; margin: 3px; padding: 5px; background-color: #3498DB; cursor: pointer; } .schedule-rows td:first-child { background-color: transparent; text-align: right; position: relative; top: -12px; } .schedule-rows td[data-selected], .schedule-rows td[data-selecting] { background-color: #E74C3C; } .schedule-rows td[data-disabled] { opacity: 0.55; } // Sun - Sat days : [0, 1, 2, 3, 4, 5, 6], // HH:mm format startTime : '08:00', // HH:mm format endTime : '20:00', // minutes interval : 30, stringDays : ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat'], // Custom template template : '' + '' + '' + '' + '' + ''
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote