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
mariarad [96]
4 years ago
8

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:

Computers and Technology
1 answer:
tatuchka [14]4 years ago
5 0

Answer:

# The user is prompted to enter the year

# the entered year is assigned to y

y = int(input("Enter the year: "))

# the remainder when y is divided by 19 is assigned to a

a = y % 19

# The quotient is assigned to b when y is divided by 100

b = y // 100

# The remainder is assigned to c when y is divided by 100

c = y % 100

# The quotient is assigned to d when b is divided by 4

d = b // 4

# The remainder is assigned to e when b is divided by 4

e = b % 4

# The quotient is assigned to g when 8 * b + 13 is divided by 25

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

# The remainder is assigned to h when 19 * a + b - d - g + 15 is divided by 30

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

# The quotient is assigned to j when c is divided by 4

j = c // 4

# The remainder is assigned to k when c is divided by 4

k = c % 4

# The quotient is assigned to m when a + 11 * h is divided by 319

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

# The remainder is assigned to r when 2 * e + 2 * j - k - h + m + 32 is divided by 7

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

# The quotient is assigned to n when h - m + r + 90 is divided by 25

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

# The remainder is assigned to p when h - m + r + n + 19 is divided by 32

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

# The date of easter is displayed

print ("Easter falls on day ", p, "of month ", n);

Explanation:

The code is written in Python and is well commented. A sample image of program output is attached.

You might be interested in
Which of the following would be a valid method call for the following method? public static void showProduct (int num1, double n
Alenkinab [10]

Answer:

showProduct(int,double)

for example: showProduct(10,10.5) is the correct answer even showProduct(10,10.0) is also correct but showProduct(10.0,10.5) or showProduct(10,10) or showProduct(10.0,10) are wrong calls.

Explanation:

The code is

  1.       <em>public static void showProduct (int num1, double num2){</em>
  2. <em>       int product;</em>
  3. <em>       product = num1*(int)num2;</em>
  4. <em>       System.out.println("The product is "+product);</em>
  5. <em>       }</em>

showProduct is function which asks for two arguments whenever it is called, first one is integer and second one is of type double which is nothing but decimal point numbers. Generally, in programming languages, 10 is treated as integer but 10.0 is treated as decimal point number, but in real life they are same.

If showProduct( 10,10.0) is called the output will be 'The product is 100'.

Strange fact is that, if you enter showProduct(10,10.5) the output will remain same as 'The product is 100'. This happens because in the 3rd line of code,which is <em>product=num1*(int)num2</em>, (int) is placed before num2 which makes num2 as of type integer, which means whatever the value of num2 two is given, numbers after decimal is erased and only the integer part is used there.

This is necessary in JAVA and many other programming languages as you <u>cannot</u><u> multiply two different datatypes</u> (here one is int and another is double). Either both of them should be of type int or both should be of type double.

3 0
3 years ago
I got enough points and enough brainliests how do I move on to my next rank?
emmasim [6.3K]

Answer: what do you mean exactly?

6 0
3 years ago
Read 2 more answers
What two methods can be used to access and modify an existing program that is running on an iot device in cisco packet tracer? (
dsp73

Cisco Packet Tracer is tool used for network simulation and visualization program.

The two methods can be used to access and modify an existing program that is running on an IoT device in Cisco packet trace are the following:

1. Click on the device then select the Programming tab.

2. Go to the registration server and login. Then select the Editor tab.

3 0
4 years ago
Is a growing network of physical objects that have sensors connected to the internet?
dimulka [17.4K]
"growing network of physical objects that will have sensors connected to the internet referred to as the internet of - things"
5 0
3 years ago
What does JPEG stand for?
ArbitrLikvidat [17]
Joint Photographic Experts Group
7 0
3 years ago
Read 2 more answers
Other questions:
  • Which of the following is NOT a group on the Slide Master tab?
    6·1 answer
  • Kumar was working on his term paper and had not saved his work before the battery died on his laptop. He panics because the pape
    12·1 answer
  • How might your use of computers and knowledge of technology systems affect your personal and professional success?
    14·1 answer
  • Anna’s computer will not power on. What aspect of the computer should Anna check (hardware or software)? How can Anna work to re
    5·1 answer
  • Assume that a function with this header: function amountSaved(price, discountRate, salesTaxRate) already exists. Write a single
    14·1 answer
  • What would happen to life on earth if the ozeon layer was not present?
    7·2 answers
  • Using the simple alphabet code below, you will decode and encode the message. Write the Full
    6·1 answer
  • Describe two types of software suites supporting your answer with three examples each.
    12·1 answer
  • Steps for Saving and opening a document.​
    14·1 answer
  • A large organization is struggling to close the gaps in skill levels that exist between its employees and those from competing c
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!