---+ Repetition 2: A month's calendar: Fall 2023 ---++ Learning Objective(s) 1 Improving repetition skills 1 Learn the *for* loop 1 Become independent when using selection statements 1 Learn to use a switch statement ---++ Overview of the Program For this lab you are to create a program that displays the calendar of a month. ---++ Specifics * The program should be called *DisplayMonth* * Input should be the year, followed by the month, and then the day it starts on (with Sunday being 0 and Saturday being 6) * The name of the month should be displayed first (you may choose the language) * You must use at least one *for* statement * You must account for leap year. Note: leap year is not a simple as every four leaps. Research the details. * The month days should line up nicely. ---++Sample dialogue Below is a sample dialogue. Your output can vary somewhat as long as the required data is nicely displayed <pre>What is the year, month and day of the week? <b>2023 09 05</b> September 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 </pre> You can also run a solution for this program if you want. See classroom instructions for more details. ---++Submission a. Create your SDR. * In *Lessons Learned*, include a discussion on about priming which selection statements you used and why. Also include a discussion on how complex the code seems * Your testing should include at least 2 different types of errors and ensure that every line of code is executed at least once and there is a least one month for each starting day. The actual start day does not have to be accurate (unless you are doing the extra credit) * If you used any hints, be sure to indicate that in the *Outside Resources Used* section a. Convert your SDR into a pdf document a. Create an empty zip folder a. Place your java file and pdf document in it. a. Submit the zip folder on canvas ---++Hints 1 [[CSC121F2023Lab04Hint1][Algorithm hint]] 1 [[CSC121F2023Lab04Hint2][Leap day]] 1 [[CSC121F2023Lab04Hint3][Formatting nicely]] ---++ 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. 1. Compute the first day of the month
This topic: CenterForComputing
>
WebHome
>
Syllabi
>
CSC121SylF2023
>
CSC121F2023Lab04
Topic revision: r1 - 2023-06-19 - cathybareiss
Copyright © 2008-2026 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki?
Send feedback