1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Nadya [2.5K]
3 years ago
15

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.
Computers and Technology
1 answer:
BlackZzzverrR [31]3 years ago
7 0

Answer:

The program written in Java without comment is as follows

import java.util.*;

public class MyClass {

   public static void main(String args[]) {

       Scanner input = new Scanner(System.in);

       System.out.print("Year: ");

       int y = input.nextInt();

       int a = y%19;

       System.out.println("a = "+a);

       int b = y / 100;

       System.out.println("b = "+b);

       int c = y%100;

       System.out.println("c = "+c);

       int d = b / 4;

       System.out.println("d = "+d);

       int e = b%4;

       System.out.println("e = "+e);

       int g = (8 * b + 13)/25;

       System.out.println("g = "+g);

       int h = (19 * a + b - d - g + 15)%30;

       System.out.println("h = "+h);

       int j = c/4;

       System.out.println("j = "+j);

       int k = c%4;

       System.out.println("k = "+k);

       int m = (a + 11 * h)/319;

       System.out.println("m = "+m);

       int r = (2 * e + 2 * j - k - h + m + 32)%7;

       System.out.println("r = "+r);

       int n = (h - m + r + 90)/25;

       System.out.println("n = "+n);

       int p = (h - m + r + n + 19)%32;

       System.out.println("p = "+p);

   }

}

Explanation:

<em>I've added the full source code as an attachment where I use comments to explain difficult lines</em>

Download java
You might be interested in
Is Using programming libraries is one way of incorporating existing code into new programs true
postnew [5]

Yes, Using programming libraries is one way of incorporating existing code into new programs  is a true statement.

<h3>What function do libraries provide in programming?</h3>

Programming libraries are helpful resources that can speed up the work of a web developer. They offer prewritten, reuseable portions of code so that programmers can easily and quickly create apps. Consider building a program that enables users to enroll in and pay for courses.

Therefore, Using a code library often saves developers from having to create everything from scratch. It can take less time to develop projects and have more reliable software if the catalog of programming resources is kept up well.

Learn more about libraries from

brainly.com/question/17960151
#SPJ1

6 0
1 year ago
Select the correct answer.
snow_tiger [21]

Answer: I think it's D.

Explanation: I'm sorry if I chose the wrong answer, I'm not too good with stuff like this.

3 0
2 years ago
How does an operating system manage peripheral devices?
azamat

Answer:

Device management controls peripheral devices by sending them commands in their proprietary machine language. The software routine that deals with each device is called a "driver," and the OS requires drivers for each of the peripherals attached to the computer.

Explanation:

4 0
3 years ago
Examine the following output:
zepelin [54]

Answer:

a. tracert

Explanation:

Tracert is a computer network diagnostic demand which displays possible routes for internet protocol network. It also measures transit delays of packets across network. The given output is produced by a tracert command.

8 0
3 years ago
Reed Hastings created Netflix. His inspiration came from the fact that he had to pay a sizeable late fee for returning a DVD bey
noname [10]

Answer:

Which statement accurately describes his key to success?

Explanation:

The success in Netflix lies in offering:

1. Entertainment;

2. fun;

3. originality;

4. innovation and

5. happiness.

Netflix learning is:

1. Bet on your content.

2. Brand Personality.

3. Visual universe.

4. Customization

5. Big Data helps Netflix continue to grow and improve customer service.

3 0
3 years ago
Other questions:
  • What does it mean to have liability for a company?
    6·1 answer
  • Jason is creating a web page for his school's basketball team. He just finished creating his storyboard. Which tool should he us
    6·2 answers
  • In 1988, Robert Morris, Jr. launched a program called the _________ that used weaknesses in e-mail programs and operating system
    5·1 answer
  • Prepare a risk assessment report (RAR) with information on the threats, vulnerabilities, likelihood of exploitation of security
    14·1 answer
  • While reading difficult content, you should always start witha.Surveying the chapterc.Reading the chapterb.Defining vocabulary w
    8·1 answer
  • You are moving to an area where DSL will be available in the next six months. Which method of internet connectivity should you i
    13·1 answer
  • What help in executing commands quickly
    5·1 answer
  • Lesson 2.7 Code Practice #2
    13·1 answer
  • computer is an electronic machine that is used for data processing to produce meaningful information explain in statement​
    5·1 answer
  • PLS HELP WITH MY PYTHON HW ILL GIVE YOU BRAINLIEST
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!