Python Programming: An Introduction to Computer Science, 3rd Ed.
Python Programming: An Introduction to Computer Science, 3rd Ed.
3rd Edition
ISBN: 9781590282755
Author: John Zelle
Publisher: Franklin, Beedle & Associates
bartleby

Videos

Question
Book Icon
Chapter 7, Problem 10PE
Program Plan Intro

Print the date of Easter

Program plan:

  • Define the function “easter()”,
    • Check whether the year lies between “1900” and “2099”,
      • If it is true, calculate the value of “a”, “b”, “c”, “d”, and “e” using the formula.
      • Check whether the sum of "d” and “e” is greater than “9”,
        • If it is true, check whether the year is either “1954” or “1981” or “2049” or “2076”,
          • If it is true, subtract 7 days from “d’ value and print the date of Easter one week too late on April.
        • Otherwise, print the date of Easter on April.
        • Otherwise, check whether the year is either “1954” or “1981” or “2049” or “2076”,
          • If it is true, subtract 7 days from “d’ value and print the date of Easter one week too late on March.
        • Otherwise, print the date of Easter on March.
      • Otherwise, print the message as “Year is out of range”.
  • Define the function “main()”,
    • Get the year from the user.
    • Call the function “easter()”.
  • Call the function “main()”.

Blurred answer
Students have asked these similar questions
Fibonacci numbers are a sequence of integers, starting with 1, where the value of each number is the sum of the two previous numbers, e.g. 1, 1, 2, 3, 5, 8, etc. Write a function called fibonacci that takes a parameter, n, which contains an integer value, and have it return the nth Fibonacci number. (There are two ways to do this: one with recursion, and one without.)
Write a program that loads in historical data on popular baby-names for the last 100 years. You can type in a name, and it graphs the rank of that name over time. A high ranking, like 5, means the name was the 5th most popular that year (top of the graph), while a low ranking like 879 means the name was not that popular (bottom of the graph).   Write it in python the latest version   The first function you will write and test is the clean_data function. The function is described in the starter code in a function header comment above the function. Here is the function:   def clean_data(list, x): #TODO: write your code here pass   Take a look at the first few lines of the data file: A 83 140 228 286 426 612 486 577 836 0 0 Aaliyah 0 0 0 0 0 0 0 0 0 380 215 Aaron 193 208 218 274 279 232 132 36 32 31 41   Each line is a baby name followed by how popular the name was in 11 different years. Each number is a ranking, so Aaron was 193th most popular name in 1900 and 41st most popular name in…
Write a program that loads in historical data on popular baby-names for the last 100 years. You can type in a name, and it graphs the rank of that name over time. A high ranking, like 5, means the name was the 5th most popular that year (top of the graph), while a low ranking like 879 means the name was not that popular (bottom of the graph).    Write it in python the latest version   The first function you will write and test is the clean_data function. The function is described in the starter code in a function header comment above the function. Here is the function:   def clean_data(list, x): #TODO: write your code here    pass   Take a look at the first few lines of the data file: A 83 140 228 286 426 612 486 577 836 0 0 Aaliyah 0 0 0 0 0 0 0 0 0 380 215 Aaron 193 208 218 274 279 232 132 36 32 31 41     Each line is a baby name followed by how popular the name was in 11 different years. Each number is a ranking, so Aaron was 193th most popular name in 1900 and 41st most…
Knowledge Booster
Background pattern image
Computer Science
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
What Are Data Types?; Author: Jabrils;https://www.youtube.com/watch?v=A37-3lflh8I;License: Standard YouTube License, CC-BY
Data Types; Author: CS50;https://www.youtube.com/watch?v=Fc9htmvVZ9U;License: Standard Youtube License