---+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 <b>Calendar</b> * Handle leap year correctly. This is more complex than it might seem. Be careful! * Use at least one <b>for</b> 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.<br> <pre> What year (between 1700 and 2700)? <b><font color="blue">2024</font></b> What month (1 - 12)? <b><font color="blue">9</font></b> What day does the month start on (0-6)? <b><font color="blue">0</font></b> 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 </pre> You can also run a solution for this program if you want. See classroom instructions for more details. ---++Lab Hints * Hint 1: [[%ATTACHURL%/CalendarFC.pdf][a flowchart that you can use]]: This flowchart is a bit more abstract on purpose. Your programming should be advancing. * Hint 2: Computing if a year is a leap year: See the Internet * Hint 3: [[CSC121F2024Lab04Hint03][Getting valid values from the user]] * Hint 4: [[CSC121F2024Lab04Hint04][Formatting output nicely]] ---++ 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 <b>Outside Resources</b> 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. 1. Compute the day of the week a given month starts. This version should be called <b>CalendarExtra.java</b> and should also be placed in the zip folder before submitting the lab.
This topic: CenterForComputing
>
WebHome
>
Syllabi
>
SyllabiFall2024
>
CSC121SylF2024
>
CSC121F2024Lab04
Topic revision: r1 - 2024-06-10 - 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