2nd Repetition Lab: Monthly Calendar: Fall 2024
Learning Objective(s)
- Learn about count controlled loops
- Understand the difference between path coverage and statement coverage
- Formatting output (some independent learning)
Overview of the Program
Write a program to display a calendar for a specific month
Specifics
- The program is to be called Calendar
- Handle leap year correctly. This is more complex than it might seem. Be careful!
- Use at least one for loop (correctly)
- Years are between 1700 and 2700.
- All data inputted must be assured to be correct.
- Get the year, month, and the day of the week (0-6) the month starts on.
- Display the month title
- Display the month (correctly).
Sample dialogue
Below is a sample dialogue. The prompts may vary but the input given by the user is to be the same format. Your output can vary somewhat as long as the required data is nicely displayed.
What year (between 1700 and 2700)? 2024
What month (1 - 12)? 9
What day does the month start on (0-6)? 0
Sep
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30
You can also run a solution for this program if you want. See classroom instructions for more details.
Lab Hints
Submission
- Create a software development report
- For the system design, you may use my flowchart if it is the design of your program. Otherwise, you need to make your own.
- For testing report,
- display complete correct output in your report for at least one month to show what it should look like. You don't need to display the complete output for each test.
- make sure you do statement coverage testing
- at the end of the testing report include a statement about how many different tests would be needed if you did path coverage testing and why that is the number.
- For the improvement section, specify how many points were lost from the last lab that you should not lose points for on this lab because you corrected the problem
- Because class did not cover how to format your output nicely, there should be something in the Outside Resources from everyone who tried to format the output.
- create a pdf document from your software development report
- create an empty zip folder
- place only Calendar.java and your pdf document into it
- submit the zip folder on canvas
Optional improvements
Optional improvements should ONLY be worked on once the program is completing working. In addition, the work is to be done on your own with little if any help for lab assistants or the instructor.
- Compute the day of the week a given month starts. This version should be called CalendarExtra.java and should also be placed in the zip folder before submitting the lab.