Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Lab06 07142017.pdf Home Tools Lab06 07142017.... X @ Yogesh , A A A A Q 0 0 3 1 3 62,1% - ... Exercise 3-

image text in transcribed

Lab06 07142017.pdf Home Tools Lab06 07142017.... X @ Yogesh , A A A A Q 0 0 3 1 3 62,1% - ... Exercise 3- Calculations (4 points) If you do not complete this exercise during the lab period, you need to complete the work outside of the lab period and bring the completed work to the lab next week. Write a class that will compute the date of Easter Sunday. Easter Sunday is the first Sunday after the first full moon of spring. To find Easter's date, use an algorithm developed by the mathematician Carl Friedrich Gauss in 1800. 1. Let y be the year; e.g. 1800, 1975 or 2014. 2. Divide y by 19 and call the remainder a. Ignore the quotient. 3. Divide y by 100 to get a quotient band remainder c. 4. Divide bby 4 to get a quotient d and remainder e 5. Divide (8 + b + 13) by 25 to get quotient g. Ignore the remainder. 6. Divide (19 * a + b - d - g + 15) by 30 to get remainder h. Ignore the quotient. 7. Divide c by 4 to get the quotient j and remainder k. 8. Divide (a + 11 * h) by 319 to get quotient m. Ignore the remainder. 9. Divide (2 * e + 2 * j - k - h + m + 32) by 7 to get remainder r. Ignore the quotient. 10. Divide (h - m + r + 90) by 25 to get quotient n. Ignore the remainder. 11. Divide (h - m + r + n + 19) by 32 to get remainder p. Ignore the quotient. The result is that Easter falls on day p of month n in the given year. For example, if y is 2001: a = 6 g = 6 m = 0 b = 20 h = 18 r = 6 a = 1 j = 0, n = 4 d = 5, e = 0 k = 1 p = 15 Therefore, in 2001, Easter Sunday falls on April 15 (n = 4 and p = 15). If you get the wrong answer, put a breakpoint on the last statement of your algorithm and check out the values of all the variables (a .. p) and see where they go wrong. Then fix your code and try again. Write a class Easter with methods getEasterSundayMonth () and getEasterSundayDay (). Write a class EasterTester that tests the Easter class, uses the scanner to get the year and produces the following output: Enter the year: 2001 Month: 4 Day: 15 Signature: Date: Have your instructor or TA sign here when Exercise 3 works correctly. ISTE-120 Page 3 of 3 LAB 06

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Modern Database Management

Authors: Jeff Hoffer, Ramesh Venkataraman, Heikki Topi

13th Edition Global Edition

1292263350, 978-1292263359

More Books

Students also viewed these Databases questions