subject

Easter Sunday is the first Sunday after the first full moon of spring. To compute the date, you can use this algorithm, invented by the mathematician Carl Friedrich Gauss in 1800: 1. Let y be the year (such as 1800 or 2001).
2. Divide y by 19 and call the remainder a. Ignore the quotient.
3. Divide y by 100 to get a quotient b and a remainder c.
4. Divide b by 4 to get a quotient d and a remainder e.
5. Divide 8 * b 13 by 25 to get a quotient g. Ignore the remainder.
6. Divide 19 * a b - d - g 15 by 30 to get a remainder h. Ignore the quotient.
7. Divide c by 4 to get a quotient j and a remainder k.
8. Divide a 11 * h by 319 to get a quotient m. Ignore the remainder.
9. Divide 2 * e 2 * j - k - h m 32 by 7 to get a remainder r. Ignore the quotient.
10. Divide h - m r 90 by 25 to get a quotient n. Ignore the remainder.
11. Divide h - m r n 19 by 32 to get a remainder p. Ignore the quotient.
Then Easter falls on day p of month n. For example, if y is 2001:
a = 6 h = 18 n = 4
b = 20, c = 1 j = 0, k = 1 p = 15
d = 5, e = 0 m = 0
g = 6 r = 6
Therefore, in 2001, Easter Sunday fell on April 15. Write a program that prompts the user for a year and prints out the month and day of Easter Sunday.
Part 1: Problem-Solving Phase
Using the Design Recipe, write each of the following for this problem:
Contract
Purpose Statement
Examples, making sure to include counter-examples
Algorithm (based on the above algorithm, completed with input/output steps)
Make sure to test your algorithm by hand with the examples to verify it before continuing to Part 2.
Part 2: Implementation Phase
Using Eclipse, write the Java program for the algorithm formulated in Part 1, and test your program with the examples from Part 1.
Make sure to incorporate your Contract, Purpose Statement and Examples as one or more comment blocks, and your Algorithm as line comments in your Java source code.

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 19:30
Once the data center routes to the destination server that hosts the website, what's the next step in the internet process? user’s browser renders html code from destination server into web page request goes through router/model and isp request routed to nameserver and datacenter
Answers: 2
question
Computers and Technology, 22.06.2019 20:40
Write a program that begins by reading in a series of positive integers on a single line of input and then computes and prints the product of those integers. integers are accepted and multiplied until the user enters an integer less than 1. this final number is not part of the product. then, the program prints the product. if the first entered number is negative or 0, the program must print “bad input.” and terminate immediately. next, the program determines and prints the prime factorization of the product, listing the factors in increasing order. if a prime number is not a factor of the product, then it
Answers: 2
question
Computers and Technology, 23.06.2019 01:40
Writing a modular program in visual c++. i am new to this and not sure what i am missing. i am getting the following error: baddate.cpp: in function ‘int main()’: baddate.cpp: 50: 3: error: ‘else’ without a previous ‘if’elsehere are the instructions and code: writing a modular program in c++in this lab, you add the input and output statements to a partially completed c++ program. when completed, the user should be able to enter a year, a month, and a day. the program then determines if the date is valid. valid years are those that are greater than 0, valid months include the values 1 through 12, and valid days include the values 1 through 31.notice that variables have been declared for you.write the simulated housekeeping() function that contains the prompts and input statements to retrieve a year, a month, and a day from the user.include the output statements in the simulated endofjob() function. the format of the output is as follows: month/day/year is a valid date.ormonth/day/year is an invalid date.execute the program entering the following date: month = 5, day = 32, year = 2014. record the output of this program.execute the program entering the following date: month = 9, day = 21, year = 2002. record the output of this /* program name: baddate.cppfunction: this program determines if a date entered by the user is valid.input: interactiveoutput: valid date is printed or user is alerted that an invalid date was entered*/#include bool validatedate(int, int, int); using namespace std; int main(){// declare variablesint year; int month; int day; const int min_year = 0, min_month = 1, max_month = 12, min_day = 1, max_day = 31; bool validdate = true; // this is the work of the housekeeping() method// get the year, then the month, then the daycout< < "enter the year"< > year; cout< < "enter the month"< > month; cout< < "enter the day"< > day; // this is the work of the detailloop() method// check to be sure date is validif(year < = min_year) // invalid yearvaliddate = false; else if (month < min_month || month > max_month) // invalid monthvaliddate = false; else if (day < min_day || day > max_day) // invalid dayvaliddate = false; // this is the work of the endofjob() method// test to see if date is valid and output date and whether it is valid or notif(validdate == true); {// output statementcout<
Answers: 1
question
Computers and Technology, 23.06.2019 11:20
Http is the protocol that governs communications between web servers and web clients (i.e. browsers). part of the protocol includes a status code returned by the server to tell the browser the status of its most recent page request. some of the codes and their meanings are listed below: 200, ok (fulfilled)403, forbidden404, not found500, server errorgiven an int variable status, write a switch statement that prints out the appropriate label from the above list based on status.
Answers: 2
You know the right answer?
Easter Sunday is the first Sunday after the first full moon of spring. To compute the date, you can...
Questions
question
Mathematics, 08.11.2019 02:31
question
English, 08.11.2019 02:31
question
Mathematics, 08.11.2019 02:31
question
Mathematics, 08.11.2019 02:31