write a program that asks user to enter a year and this program checks whether that year is leap year or not.

Briefly describe two (2) products (goods or services) offered at a business you are familiar with. Next, identify two (2) major competitors and describe the two (2) products they offer that compete with yours.
August 5, 2017
Prepare a PowerPoint presentation that would help individuals like Jeff set goals related to career, health, and family.
August 5, 2017
Show all

write a program that asks user to enter a year and this program checks whether that year is leap year or not.

Program 1: write a program that asks user to enter a year and this program checks whether that year is leap year or not. Also it should print out all a calendar for the year entered. Starting on Monday Jan 1st, 1900. Characteristic of a leap year: • It has 366 days. • February has 29 days. • February starts and ends on the same day. • January, April, and July, all start on the same day of the week. Definition: • A leap year can always be evenly divided by 4. For example, 2012 was a leap year. • But a year is not a leap year if it can be evenly divided by 100 but cannot also be evenly divided by 400. This is why 1600 and 2000 are leap years, but 1700, 1800, and 1900 are not. • A leap year can always be evenly divided by 4. • Century years must also be divisible

by 400. Pseudo code algorithm: if year is divisible by 4 then if year is divisible by 100 then if year is divisible by 400 then IS_leap_year else NOT_leap_year else IS_leap_year else NOT_leap_year Let D4 = year divisible by 4 D100 = year divisible by 100 D400

= year divisible by 400 From the definition: D4 ? (D100 ? D400) ? D4 ? (¬D100 V D400) ? (D4 ? ¬D100) V (D4 ? D400) ? (D4 ? ¬D100) V (D400) ? D400 V (D4 ? ¬D100) ? D400 V (¬D100 ? D4) or D4 ? (¬D100 V (D100 ? D400)) ? (D4 ? ¬D100) V (D4 ? D100 ? D400) ? (D4 ? ¬D100) V (D400) ? D400 V (¬D100 ? D4) IS_leap_year = D400 V (¬D100 ? D4)

  1. Write a program to perform unsigned binary 8-bit to decimal conversion and decimal to binary conversion

Leave a Reply

Your email address will not be published. Required fields are marked *