{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

csc1253proj02f10

csc1253proj02f10 - Selection Statements CSc 1253 Project 2...

Info icon This preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Selection Statements CSc 1253: Project # 2 Validating A Date Out: 9/11 Due: 9/19 by 11:50 PM Learning Objectives Using Conditional Statements Using Logical Connectors More on Writing Interactive Programs The Gregorian calendar was first introduced in October 1582 in Italy over time it replaced the Julian calendar. The Gregorian calendar is accurate but it needs a day adjustment for every intercalary year. Definition 1. The following rules apply when determining an intercalary or leap year: A. A year that is a multiple of 400 is a leap year. B. A year that is not a multiple of 100, but is a multiple of 4, is a leap year. Determining A Valid Date The following rules will apply when determining whether a given date is a valid date on the Gregorian calendar: 1. year: To simplify calculations, your program should only consider years after 1582. 2. month: Valid months are in the range [1,12]. 3. day: If the value entered for the month is 1, 3, 5, 7, 8, 10 or 12, the value for day must be in the range [1,31]. If the value entered for the month is 4, 6, 9 or 11, the value for day must be in the range [1,30]. If the value entered for the month is 2, the value for day must be in the range [1,29] for leap years and [1,28] for non-leap years.
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern