In the modem Gregorian calendar (first adopted in 1582), an extra day (February 29) is added...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
In the modem Gregorian calendar (first adopted in 1582), an extra day (February 29) is added to the calendar to keep calendar years synchronized with astronomical years. Leap years occur according to the following rules: 1. Every year that is exactly divisible by four is a leap year, except for years that are exactly divisible by 100 (centurial years), which have additional rules. 2. Centurial years are leap years only if they are exactly divisible by 400. For example, the centurial years 1800 and 1900 are not leap years, but the centurial years 1600 and 2000 are. Write a program that asks the user to input a year and determine if input is a leap year. You can assume that the user will always enter an integer value. If the year is before 1582, the program should print a statement that says it precedes the adoption of the Gregorian calendar. If the year is 1582 or later, the program will print a statement saying whether it was or will be a leap year. Formatting guidelines: the first argument of the print statement should be a tab escape character. Below are some sample runnings of the program. Example 1 Enter year: 1851 1851 is NOT a leap year. Example 2 Enter year: 1600 1600 is a leap year. Example 3 Enter year: 1581 1581 is before the adoption of the Gregorian calendar. Example 4 Enter year: 2020 2020 is a leap year. Example 5 Enter year: 2022 2022 is NOT a leap year. In the modem Gregorian calendar (first adopted in 1582), an extra day (February 29) is added to the calendar to keep calendar years synchronized with astronomical years. Leap years occur according to the following rules: 1. Every year that is exactly divisible by four is a leap year, except for years that are exactly divisible by 100 (centurial years), which have additional rules. 2. Centurial years are leap years only if they are exactly divisible by 400. For example, the centurial years 1800 and 1900 are not leap years, but the centurial years 1600 and 2000 are. Write a program that asks the user to input a year and determine if input is a leap year. You can assume that the user will always enter an integer value. If the year is before 1582, the program should print a statement that says it precedes the adoption of the Gregorian calendar. If the year is 1582 or later, the program will print a statement saying whether it was or will be a leap year. Formatting guidelines: the first argument of the print statement should be a tab escape character. Below are some sample runnings of the program. Example 1 Enter year: 1851 1851 is NOT a leap year. Example 2 Enter year: 1600 1600 is a leap year. Example 3 Enter year: 1581 1581 is before the adoption of the Gregorian calendar. Example 4 Enter year: 2020 2020 is a leap year. Example 5 Enter year: 2022 2022 is NOT a leap year.
Expert Answer:
Related Book For
Posted Date:
Students also viewed these programming questions
-
how to complete the disclosure accounting healthcare law and ethics
-
The Julian calendar was a reform of the Roman calendar introduced by Julius Caesar in 46 BC (708 AUC). It took effect in 45 BC (709AUC). It was the predominant calendar in most of Europe, and in...
-
can someone solve this Modern workstations typically have memory systems that incorporate two or three levels of caching. Explain why they are designed like this. [4 marks] In order to investigate...
-
What are the costs of healthcare, where does the money come from, and where is it spent?
-
Some factors that contribute to the compensation of expatriate managers include what?
-
What are some other techniques you use to help you complete activities in your life?
-
What do budgets have to do with control? R-3
-
Multiple Choice Questions 1. The prisoners' dilemma is an example of a. A sequential game. b. A simultaneous game. c. A shirking game. d. A dating game 2. Nash equilibrium a. Is where one player...
-
Help me solve this problem 3 A. Estimate Ifdx l 'l . a . Estimate the integral using 4 rectangles and left endpoints. b. Did you underestimate or overestimate the area? C e. a. b. C e. . Write out...
-
Your company makes metal outdoor furniture from scratch - that is to say, you currently make all components for the furniture from their raw materials ( sheet metal, paint, nuts & bolts, etc. )...
-
The following shareholders' equity accounts are reported by Blossom Inc. on January 1: Common shares (unlimited authorized, 135,000 issued) $2,025,000 Preferred shares ($4 cumulative, convertible,...
-
Analyze the quarterly costs of a manufacturing firm for three different production costs over four quarters. Quarter Units Produced Total Cost P Cost per Unit P Total Cost Q Cost per Unit Q Total...
-
he City of Waterman established a capital projects fund for the construction of an access ramp from the parking garage to the citys office building to be used by individuals with disabilities. The...
-
A construction company evaluates its project costs for three different types of costs over four months. Month Projects Completed Total Cost R Cost per Project R Total Cost S Cost per Project S Total...
-
Bottles Sold Napa Valley Winery has sought your expertise to help them compare forecasted sales using a regression trendline approach and exponential smoothing. They face a very pronounced seasonal...
-
ABC Audio sells headphones and would like to earn an after-tax profit of $776 every week. Each set of headphones incurs variable cost of $10 and sells for $20. Rent and other fixed costs are $280...
-
Using Gauss-Jordan elimination, invert this matrix ONLY 0 0 0 0 1
-
(Trading volume and return) A well-known finance professor published a paper in which he argued that due to the high volume of stock trade in the Internet, he expects stock returns to decline in...
-
(Risk and return) Can you think of a risk-based explanation for the following finding? Over the last 40 years, small stocksdefined as shares of firms with a low market valuehad higher returns than...
-
(Compute average return and sigma) Go to the Principles of Finance with Excel companion website for Chapter 7, where youll find a template with data on annual stock prices for Kellogg and Ford for...
![Mobile App Logo](https://dsd5zvtm8ll6.cloudfront.net/includes/images/mobile/finalLogo.png)
Study smarter with the SolutionInn App