SlideShare a Scribd company logo
1 of 1
Download to read offline
Objectives:
The objective of this program is to test your ability to perform Python arithmetic, input/output,
decision, and repetition statements.
Description:
The following algorithm will calculate the date of Easter for any year in the twentieth or twenty-
first centuries for Western dates. Valid years are 1900 to 2099. Have the user input a positive
year.
Subtract 1900 from the user input year and call the difference valueD.
Divide valueD by 19 and call the remainder valueR.
Divide (7 * valueR + 1) by 19. Discard the remainder and call the quotient valueP.
Divide (11 * valueR + 4 valueP) by 29 and call the remainder valueS.
Divide valueD by 4. Discard the remainder and call the quotient valueQ.
Divide (valueD + valueQ + 31 valueS) by 7 and call the remainder valueT.
Easter is on (25 valueS valueT). If this result is greater than zero, Easter for that year occurs in
April on that date.
If the result is zero or negative Easter for that year falls in March. If the result is 0, Easter for
that year falls on March 31 (31 0). If the result is 1, Easter occurs on March 30 (31 1). If the
result is 2, Easter occurs on March 29 (31 2), etc. (Hint: What happens when you subtract a
negative number (-1) from a number as in (31 (-1))?)
Assignment:
Write a program, name it Easter.py that will ask the user to input a year and calculate the date of
Easter for that year. You may need to verify your programs accuracy by doing each step by hand
then check your programs values at that point. Your program should produce a single line of
output of the form:
(Western) Easter Sunday - 28 March, 1948.
Assume the user always inputs a valid year.
Once your program outputs, it should loop back to the beginning and ask the user for another
year. If the user inputs a negative year, stop the program, and say Bye

More Related Content

More from aliracreations

One day, Alex got tired of climbing in a gym and decided to take a v.pdf
One day, Alex got tired of climbing in a gym and decided to take a v.pdfOne day, Alex got tired of climbing in a gym and decided to take a v.pdf
One day, Alex got tired of climbing in a gym and decided to take a v.pdfaliracreations
 
On November 1, 2021 a company sign a $200,000.12 percent six-month n.pdf
On November 1, 2021 a company sign a $200,000.12 percent six-month n.pdfOn November 1, 2021 a company sign a $200,000.12 percent six-month n.pdf
On November 1, 2021 a company sign a $200,000.12 percent six-month n.pdfaliracreations
 
On January 1, Year 2, Kincaid Companys Accounts Receivable and the .pdf
On January 1, Year 2, Kincaid Companys Accounts Receivable and the .pdfOn January 1, Year 2, Kincaid Companys Accounts Receivable and the .pdf
On January 1, Year 2, Kincaid Companys Accounts Receivable and the .pdfaliracreations
 
On January 1, 2021, Daniel Corp. acquired 80 of the voting common s.pdf
On January 1, 2021, Daniel Corp. acquired 80 of the voting common s.pdfOn January 1, 2021, Daniel Corp. acquired 80 of the voting common s.pdf
On January 1, 2021, Daniel Corp. acquired 80 of the voting common s.pdfaliracreations
 
On December 31, Year 3, Mueller Corp. acquired 80 of the outstandin.pdf
On December 31, Year 3, Mueller Corp. acquired 80 of the outstandin.pdfOn December 31, Year 3, Mueller Corp. acquired 80 of the outstandin.pdf
On December 31, Year 3, Mueller Corp. acquired 80 of the outstandin.pdfaliracreations
 
No plagiarism. At least 250 wordsWhat is the relationship be.pdf
No plagiarism. At least 250 wordsWhat is the relationship be.pdfNo plagiarism. At least 250 wordsWhat is the relationship be.pdf
No plagiarism. At least 250 wordsWhat is the relationship be.pdfaliracreations
 
On August 1, 2024, Trico Technologies, an aeronautic electronics com.pdf
On August 1, 2024, Trico Technologies, an aeronautic electronics com.pdfOn August 1, 2024, Trico Technologies, an aeronautic electronics com.pdf
On August 1, 2024, Trico Technologies, an aeronautic electronics com.pdfaliracreations
 
On April 1, Mathis purchased merchandise on account from Reece with .pdf
On April 1, Mathis purchased merchandise on account from Reece with .pdfOn April 1, Mathis purchased merchandise on account from Reece with .pdf
On April 1, Mathis purchased merchandise on account from Reece with .pdfaliracreations
 
On 1 January 2021, Alpha Ltd sold inventory to Beta Ltd for $90 000..pdf
On 1 January 2021, Alpha Ltd sold inventory to Beta Ltd for $90 000..pdfOn 1 January 2021, Alpha Ltd sold inventory to Beta Ltd for $90 000..pdf
On 1 January 2021, Alpha Ltd sold inventory to Beta Ltd for $90 000..pdfaliracreations
 
New York State, county, city, school district, and other government .pdf
New York State, county, city, school district, and other government .pdfNew York State, county, city, school district, and other government .pdf
New York State, county, city, school district, and other government .pdfaliracreations
 
Objective The purpose of this exercise is to create a Linked List d.pdf
Objective The purpose of this exercise is to create a Linked List d.pdfObjective The purpose of this exercise is to create a Linked List d.pdf
Objective The purpose of this exercise is to create a Linked List d.pdfaliracreations
 
nsan davranlar �almasnda, �rg�tsel liderler insanlarn deerleri, tutu.pdf
nsan davranlar �almasnda, �rg�tsel liderler insanlarn deerleri, tutu.pdfnsan davranlar �almasnda, �rg�tsel liderler insanlarn deerleri, tutu.pdf
nsan davranlar �almasnda, �rg�tsel liderler insanlarn deerleri, tutu.pdfaliracreations
 
nsan adaptasyonu genetik, geliimsel, iklimlendirme ve k�lt�rel olmak.pdf
nsan adaptasyonu genetik, geliimsel, iklimlendirme ve k�lt�rel olmak.pdfnsan adaptasyonu genetik, geliimsel, iklimlendirme ve k�lt�rel olmak.pdf
nsan adaptasyonu genetik, geliimsel, iklimlendirme ve k�lt�rel olmak.pdfaliracreations
 
Nurse is performing a vaginal exan on a patient who is in labor .pdf
Nurse is performing a vaginal exan on a patient who is in labor .pdfNurse is performing a vaginal exan on a patient who is in labor .pdf
Nurse is performing a vaginal exan on a patient who is in labor .pdfaliracreations
 
Nowadays, due to the sophistication of adversarial attack vectors, t.pdf
Nowadays, due to the sophistication of adversarial attack vectors, t.pdfNowadays, due to the sophistication of adversarial attack vectors, t.pdf
Nowadays, due to the sophistication of adversarial attack vectors, t.pdfaliracreations
 
Novak proposes a �new theology� and �a new type of religion� (plural.pdf
Novak proposes a �new theology� and �a new type of religion� (plural.pdfNovak proposes a �new theology� and �a new type of religion� (plural.pdf
Novak proposes a �new theology� and �a new type of religion� (plural.pdfaliracreations
 
Norve� ve Almanya i�in Ekonomik Karmaklk G�zlemevindeki (oec.world).pdf
Norve� ve Almanya i�in Ekonomik Karmaklk G�zlemevindeki (oec.world).pdfNorve� ve Almanya i�in Ekonomik Karmaklk G�zlemevindeki (oec.world).pdf
Norve� ve Almanya i�in Ekonomik Karmaklk G�zlemevindeki (oec.world).pdfaliracreations
 
Naomi Bishop (Anna Gunn) y Michael Connor (James Purefoy) trabajaron.pdf
Naomi Bishop (Anna Gunn) y Michael Connor (James Purefoy) trabajaron.pdfNaomi Bishop (Anna Gunn) y Michael Connor (James Purefoy) trabajaron.pdf
Naomi Bishop (Anna Gunn) y Michael Connor (James Purefoy) trabajaron.pdfaliracreations
 
need proof with proper calculation, correct proof will get ups Let X.pdf
need proof with proper calculation, correct proof will get ups Let X.pdfneed proof with proper calculation, correct proof will get ups Let X.pdf
need proof with proper calculation, correct proof will get ups Let X.pdfaliracreations
 
NEED HELP!! Students were surveyed on campus about their study habit.pdf
NEED HELP!! Students were surveyed on campus about their study habit.pdfNEED HELP!! Students were surveyed on campus about their study habit.pdf
NEED HELP!! Students were surveyed on campus about their study habit.pdfaliracreations
 

More from aliracreations (20)

One day, Alex got tired of climbing in a gym and decided to take a v.pdf
One day, Alex got tired of climbing in a gym and decided to take a v.pdfOne day, Alex got tired of climbing in a gym and decided to take a v.pdf
One day, Alex got tired of climbing in a gym and decided to take a v.pdf
 
On November 1, 2021 a company sign a $200,000.12 percent six-month n.pdf
On November 1, 2021 a company sign a $200,000.12 percent six-month n.pdfOn November 1, 2021 a company sign a $200,000.12 percent six-month n.pdf
On November 1, 2021 a company sign a $200,000.12 percent six-month n.pdf
 
On January 1, Year 2, Kincaid Companys Accounts Receivable and the .pdf
On January 1, Year 2, Kincaid Companys Accounts Receivable and the .pdfOn January 1, Year 2, Kincaid Companys Accounts Receivable and the .pdf
On January 1, Year 2, Kincaid Companys Accounts Receivable and the .pdf
 
On January 1, 2021, Daniel Corp. acquired 80 of the voting common s.pdf
On January 1, 2021, Daniel Corp. acquired 80 of the voting common s.pdfOn January 1, 2021, Daniel Corp. acquired 80 of the voting common s.pdf
On January 1, 2021, Daniel Corp. acquired 80 of the voting common s.pdf
 
On December 31, Year 3, Mueller Corp. acquired 80 of the outstandin.pdf
On December 31, Year 3, Mueller Corp. acquired 80 of the outstandin.pdfOn December 31, Year 3, Mueller Corp. acquired 80 of the outstandin.pdf
On December 31, Year 3, Mueller Corp. acquired 80 of the outstandin.pdf
 
No plagiarism. At least 250 wordsWhat is the relationship be.pdf
No plagiarism. At least 250 wordsWhat is the relationship be.pdfNo plagiarism. At least 250 wordsWhat is the relationship be.pdf
No plagiarism. At least 250 wordsWhat is the relationship be.pdf
 
On August 1, 2024, Trico Technologies, an aeronautic electronics com.pdf
On August 1, 2024, Trico Technologies, an aeronautic electronics com.pdfOn August 1, 2024, Trico Technologies, an aeronautic electronics com.pdf
On August 1, 2024, Trico Technologies, an aeronautic electronics com.pdf
 
On April 1, Mathis purchased merchandise on account from Reece with .pdf
On April 1, Mathis purchased merchandise on account from Reece with .pdfOn April 1, Mathis purchased merchandise on account from Reece with .pdf
On April 1, Mathis purchased merchandise on account from Reece with .pdf
 
On 1 January 2021, Alpha Ltd sold inventory to Beta Ltd for $90 000..pdf
On 1 January 2021, Alpha Ltd sold inventory to Beta Ltd for $90 000..pdfOn 1 January 2021, Alpha Ltd sold inventory to Beta Ltd for $90 000..pdf
On 1 January 2021, Alpha Ltd sold inventory to Beta Ltd for $90 000..pdf
 
New York State, county, city, school district, and other government .pdf
New York State, county, city, school district, and other government .pdfNew York State, county, city, school district, and other government .pdf
New York State, county, city, school district, and other government .pdf
 
Objective The purpose of this exercise is to create a Linked List d.pdf
Objective The purpose of this exercise is to create a Linked List d.pdfObjective The purpose of this exercise is to create a Linked List d.pdf
Objective The purpose of this exercise is to create a Linked List d.pdf
 
nsan davranlar �almasnda, �rg�tsel liderler insanlarn deerleri, tutu.pdf
nsan davranlar �almasnda, �rg�tsel liderler insanlarn deerleri, tutu.pdfnsan davranlar �almasnda, �rg�tsel liderler insanlarn deerleri, tutu.pdf
nsan davranlar �almasnda, �rg�tsel liderler insanlarn deerleri, tutu.pdf
 
nsan adaptasyonu genetik, geliimsel, iklimlendirme ve k�lt�rel olmak.pdf
nsan adaptasyonu genetik, geliimsel, iklimlendirme ve k�lt�rel olmak.pdfnsan adaptasyonu genetik, geliimsel, iklimlendirme ve k�lt�rel olmak.pdf
nsan adaptasyonu genetik, geliimsel, iklimlendirme ve k�lt�rel olmak.pdf
 
Nurse is performing a vaginal exan on a patient who is in labor .pdf
Nurse is performing a vaginal exan on a patient who is in labor .pdfNurse is performing a vaginal exan on a patient who is in labor .pdf
Nurse is performing a vaginal exan on a patient who is in labor .pdf
 
Nowadays, due to the sophistication of adversarial attack vectors, t.pdf
Nowadays, due to the sophistication of adversarial attack vectors, t.pdfNowadays, due to the sophistication of adversarial attack vectors, t.pdf
Nowadays, due to the sophistication of adversarial attack vectors, t.pdf
 
Novak proposes a �new theology� and �a new type of religion� (plural.pdf
Novak proposes a �new theology� and �a new type of religion� (plural.pdfNovak proposes a �new theology� and �a new type of religion� (plural.pdf
Novak proposes a �new theology� and �a new type of religion� (plural.pdf
 
Norve� ve Almanya i�in Ekonomik Karmaklk G�zlemevindeki (oec.world).pdf
Norve� ve Almanya i�in Ekonomik Karmaklk G�zlemevindeki (oec.world).pdfNorve� ve Almanya i�in Ekonomik Karmaklk G�zlemevindeki (oec.world).pdf
Norve� ve Almanya i�in Ekonomik Karmaklk G�zlemevindeki (oec.world).pdf
 
Naomi Bishop (Anna Gunn) y Michael Connor (James Purefoy) trabajaron.pdf
Naomi Bishop (Anna Gunn) y Michael Connor (James Purefoy) trabajaron.pdfNaomi Bishop (Anna Gunn) y Michael Connor (James Purefoy) trabajaron.pdf
Naomi Bishop (Anna Gunn) y Michael Connor (James Purefoy) trabajaron.pdf
 
need proof with proper calculation, correct proof will get ups Let X.pdf
need proof with proper calculation, correct proof will get ups Let X.pdfneed proof with proper calculation, correct proof will get ups Let X.pdf
need proof with proper calculation, correct proof will get ups Let X.pdf
 
NEED HELP!! Students were surveyed on campus about their study habit.pdf
NEED HELP!! Students were surveyed on campus about their study habit.pdfNEED HELP!! Students were surveyed on campus about their study habit.pdf
NEED HELP!! Students were surveyed on campus about their study habit.pdf
 

Recently uploaded

ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxiammrhaywood
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxRaymartEstabillo3
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Celine George
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Celine George
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayMakMakNepo
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........LeaCamillePacle
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Mark Reed
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfSpandanaRallapalli
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomnelietumpap1
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...Nguyen Thanh Tu Collection
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 

Recently uploaded (20)

ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptxECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
ECONOMIC CONTEXT - PAPER 1 Q3: NEWSPAPERS.pptx
 
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptxEPANDING THE CONTENT OF AN OUTLINE using notes.pptx
EPANDING THE CONTENT OF AN OUTLINE using notes.pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17Field Attribute Index Feature in Odoo 17
Field Attribute Index Feature in Odoo 17
 
Raw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptxRaw materials used in Herbal Cosmetics.pptx
Raw materials used in Herbal Cosmetics.pptx
 
Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17Difference Between Search & Browse Methods in Odoo 17
Difference Between Search & Browse Methods in Odoo 17
 
Quarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up FridayQuarter 4 Peace-education.pptx Catch Up Friday
Quarter 4 Peace-education.pptx Catch Up Friday
 
Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........Atmosphere science 7 quarter 4 .........
Atmosphere science 7 quarter 4 .........
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)Influencing policy (training slides from Fast Track Impact)
Influencing policy (training slides from Fast Track Impact)
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
ACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdfACC 2024 Chronicles. Cardiology. Exam.pdf
ACC 2024 Chronicles. Cardiology. Exam.pdf
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
ENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choomENGLISH6-Q4-W3.pptxqurter our high choom
ENGLISH6-Q4-W3.pptxqurter our high choom
 
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
HỌC TỐT TIẾNG ANH 11 THEO CHƯƠNG TRÌNH GLOBAL SUCCESS ĐÁP ÁN CHI TIẾT - CẢ NĂ...
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 

ObjectivesThe objective of this program is to test your ability t.pdf

  • 1. Objectives: The objective of this program is to test your ability to perform Python arithmetic, input/output, decision, and repetition statements. Description: The following algorithm will calculate the date of Easter for any year in the twentieth or twenty- first centuries for Western dates. Valid years are 1900 to 2099. Have the user input a positive year. Subtract 1900 from the user input year and call the difference valueD. Divide valueD by 19 and call the remainder valueR. Divide (7 * valueR + 1) by 19. Discard the remainder and call the quotient valueP. Divide (11 * valueR + 4 valueP) by 29 and call the remainder valueS. Divide valueD by 4. Discard the remainder and call the quotient valueQ. Divide (valueD + valueQ + 31 valueS) by 7 and call the remainder valueT. Easter is on (25 valueS valueT). If this result is greater than zero, Easter for that year occurs in April on that date. If the result is zero or negative Easter for that year falls in March. If the result is 0, Easter for that year falls on March 31 (31 0). If the result is 1, Easter occurs on March 30 (31 1). If the result is 2, Easter occurs on March 29 (31 2), etc. (Hint: What happens when you subtract a negative number (-1) from a number as in (31 (-1))?) Assignment: Write a program, name it Easter.py that will ask the user to input a year and calculate the date of Easter for that year. You may need to verify your programs accuracy by doing each step by hand then check your programs values at that point. Your program should produce a single line of output of the form: (Western) Easter Sunday - 28 March, 1948. Assume the user always inputs a valid year. Once your program outputs, it should loop back to the beginning and ask the user for another year. If the user inputs a negative year, stop the program, and say Bye