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.pdf
aliracreations
 
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
aliracreations
 
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
aliracreations
 

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

1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
QucHHunhnh
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
kauryashika82
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
ciinovamais
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
Chris Hunter
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
QucHHunhnh
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
negromaestrong
 

Recently uploaded (20)

Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
Python Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docxPython Notes for mca i year students osmania university.docx
Python Notes for mca i year students osmania university.docx
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17  How to Extend Models Using Mixin ClassesMixin Classes in Odoo 17  How to Extend Models Using Mixin Classes
Mixin Classes in Odoo 17 How to Extend Models Using Mixin Classes
 
psychiatric nursing HISTORY COLLECTION .docx
psychiatric  nursing HISTORY  COLLECTION  .docxpsychiatric  nursing HISTORY  COLLECTION  .docx
psychiatric nursing HISTORY COLLECTION .docx
 
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
Ecological Succession. ( ECOSYSTEM, B. Pharmacy, 1st Year, Sem-II, Environmen...
 
Measures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and ModeMeasures of Central Tendency: Mean, Median and Mode
Measures of Central Tendency: Mean, Median and Mode
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Making and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdfMaking and Justifying Mathematical Decisions.pdf
Making and Justifying Mathematical Decisions.pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
1029 - Danh muc Sach Giao Khoa 10 . pdf
1029 -  Danh muc Sach Giao Khoa 10 . pdf1029 -  Danh muc Sach Giao Khoa 10 . pdf
1029 - Danh muc Sach Giao Khoa 10 . pdf
 
Seal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptxSeal of Good Local Governance (SGLG) 2024Final.pptx
Seal of Good Local Governance (SGLG) 2024Final.pptx
 
Unit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptxUnit-IV- Pharma. Marketing Channels.pptx
Unit-IV- Pharma. Marketing Channels.pptx
 
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural ResourcesEnergy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
Energy Resources. ( B. Pharmacy, 1st Year, Sem-II) Natural Resources
 

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