A handy reference for students.
At the beginning of the academic year students are issued with a timetable to show which lessons they have each week. In this program a school week is five days, each with six lessons, but this could easily be changed.
It is helpful for students to create their own copy of their timetable as a handy reference. This program allows the user to create, save, load and output a timetable.
These objectives get progressively harder. Attempt as much of the program as you can in the order presented below. Remember to use a comment to describe a subpprogram, selection or iteration.
Use this boilerplate code as a starting point:
1 mark
You can visualise the initial timetable like this. Each row is a day 1-5 and each column is a lesson 1-6:
1 | 2 | 3 | 4 | 5 | 6 | |
---|---|---|---|---|---|---|
1 | === | === | === | === | === | === |
2 | === | === | === | === | === | === |
3 | === | === | === | === | === | === |
4 | === | === | === | === | === | === |
5 | === | === | === | === | === | === |
6 marks
7 marks
5 marks
3 marks
4 marks
3 marks
1. Output timetable
2. Edit a lesson
3. Load
4. Save
5. Close
Enter choice: 1
|-1-||-2-||-3-||-4-||-5-||-6-|
1|===||===||===||===||===||===|
2|===||===||===||===||===||===|
3|===||===||===||===||===||===|
4|===||===||===||===||===||===|
5|===||===||===||===||===||===|
1. Output timetable
2. Edit a lesson
3. Load
4. Save
5. Close
Enter choice: 2
Which day do you want to edit? 1-14: 3
Which lesson do you want to edit? 1-6: 5
Enter the subject: ENG
Lesson updated.
1. Output timetable
2. Edit a lesson
3. Load
4. Save
5. Close
Enter choice: 1
|-1-||-2-||-3-||-4-||-5-||-6-|
1|===||===||===||===||===||===|
2|===||===||===||===||===||===|
3|===||===||===||===||ENG||===|
4|===||===||===||===||===||===|
5|===||===||===||===||===||===|
1. Output timetable
2. Edit a lesson
3. Load
4. Save
5. Close
Enter choice: 5
2 marks
Maximum mark: 31
If you score less than 25 you need more practice at levels 1-9 before you continue to the next level.
Use these resources as a reference to help you meet the success criteria.
Run the unit tests below to check that your program has met the success criteria.
1. Output timetable
2. Edit a lesson
3. Load
4. Save
5. Close
Enter choice: 4
Timetable saved.
1. Output timetable
2. Edit a lesson
3. Load
4. Save
5. Close
Enter choice: 3
Timetable loaded.
1. Output timetable
2. Edit a lesson
3. Load
4. Save
5. Close
Enter choice: 1
|-1-||-2-||-3-||-4-||-5-||-6-|
1|===||===||===||===||===||===|
2|===||===||===||===||===||===|
3|===||===||===||===||===||===|
4|===||===||===||===||===||===|
5|===||===||===||===||===||===|
1. Output timetable
2. Edit a lesson
3. Load
4. Save
5. Close
Enter choice: 5
1. Output timetable
2. Edit a lesson
3. Load
4. Save
5. Close
Enter choice: 2
Which day do you want to edit? 1-5: 1
Which lesson do you want to edit? 1-6: 1
Enter the subject: ENG
Lesson updated.
1. Output timetable
2. Edit a lesson
3. Load
4. Save
5. Close
Enter choice: 2
Which day do you want to edit? 1-5: 1
Which lesson do you want to edit? 1-6: 2
Enter the subject: MAT
Lesson updated.
1. Output timetable
2. Edit a lesson
3. Load
4. Save
5. Close
Enter choice: 1
|-1-||-2-||-3-||-4-||-5-||-6-|
1|ENG||MAT||===||===||===||===|
2|===||===||===||===||===||===|
3|===||===||===||===||===||===|
4|===||===||===||===||===||===|
5|===||===||===||===||===||===|
1. Output timetable
2. Edit a lesson
3. Load
4. Save
5. Close
Enter choice: 5
1. Output timetable
2. Edit a lesson
3. Load
4. Save
5. Close
Enter choice: 2
Which day do you want to edit? 1-5: 1
Which lesson do you want to edit? 1-6: 1
Enter the subject: English
Lesson updated.
1. Output timetable
2. Edit a lesson
3. Load
4. Save
5. Close
Enter choice: 2
Which day do you want to edit? 1-5: 2
Which lesson do you want to edit? 1-6: 1
Enter the subject: Science
Lesson updated.
1. Output timetable
2. Edit a lesson
3. Load
4. Save
5. Close
Enter choice: 1
|-1-||-2-||-3-||-4-||-5-||-6-|
1|ENG||===||===||===||===||===|
2|SCI||===||===||===||===||===|
3|===||===||===||===||===||===|
4|===||===||===||===||===||===|
5|===||===||===||===||===||===|
1. Output timetable
2. Edit a lesson
3. Load
4. Save
5. Close
Enter choice: 5
1. Output timetable
2. Edit a lesson
3. Load
4. Save
5. Close
Enter choice: 2
Which day do you want to edit? 1-5: 5
Which lesson do you want to edit? 1-6: 6
Enter the subject: French
Lesson updated.
1. Output timetable
2. Edit a lesson
3. Load
4. Save
5. Close
Enter choice: 2
Which day do you want to edit? 1-5: 1
Which lesson do you want to edit? 1-6: 1
Enter the subject: Spanish
Lesson updated.
1. Output timetable
2. Edit a lesson
3. Load
4. Save
5. Close
Enter choice: 4
Timetable saved.
1. Output timetable
2. Edit a lesson
3. Load
4. Save
5. Close
Enter choice: 3
Timetable loaded.
1. Output timetable
2. Edit a lesson
3. Load
4. Save
5. Close
Enter choice: 1
|-1-||-2-||-3-||-4-||-5-||-6-|
1|SPA||===||===||===||===||===|
2|===||===||===||===||===||===|
3|===||===||===||===||===||===|
4|===||===||===||===||===||===|
5|===||===||===||===||===||FRE|
1. Output timetable
2. Edit a lesson
3. Load
4. Save
5. Close
Enter choice: 5