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

Concept explainers

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

Print grade

Program plan:

  • Define the function “main()”,
    • Get the exam score from the user using “input()” method.
    • Check whether the score is greater than or equal to “90” using “if” statement,
      • If it is true, then print the grade as “A”.
    • Otherwise, check whether the score is lies between “80” and “89” using “elif” statement,
      • If it is true, then print the grade as “B”.
    • Otherwise, check whether the score is lies between “70” and “79” using “elif” statement,
      • If it is true, then print the grade as “C”.
    • Otherwise, check whether the score is lies between “60” and “69” using “elif” statement,
      • If it is true, then print the grade as “D”.
    • Otherwise, check whether the score is less than “60” using “elif” statement,
      • If it is true, then print the grade as “F”.
    • Otherwise, print the string “Kindly enter an integer between 0 and 100”.
  • Call the function “main()”.

Blurred answer
Students have asked these similar questions
A business law class of 25 students takes a midterm exam that has 100 true- or-false questions. The instructor, who is also a computer fanatic, wants to devise a program to obtain a printout with the student's name, score, and letter grade, according to the following schedule: 50 or below F 51 - 55 D 56 – 60 C- 61 - 65 66 – 70 C+ 71 - 75 B- 76 - 80 81 - 85 86 – 90 B B+ А- 91 - 95 A 96 – 100 A+ In addition, the instructor wants to include the total number of students scoring each of the 11 possible grades. How would you use the FORTRAN language to solve his problem?
Use C Language Airline Reservation System   A small airline has just purchased a computer for its new automated reservations system. The president has asked you to program the new system. You are to write a program to assign seats on each flight of the airline's only plane (capacity: 10 seats). Your program should display the following menu of alternatives:   Please type 1 for "first class" Please type 2 for "economy"   If the person types 1, then your program should assign a seat in the first class section (seats 1-5). If the person types 2, then your program should assign a seat in the economy section (seats 6-10). Your program should then print a boarding pass indicating the person's seat number and whether it is in the first class or economy section of the plane. Use a single-subscripted array to represent the seating chart of the plane. Initialize all the elements of the array to 0 to indicate that all seats are empty. As each seat is assigned, set the corresponding elements of…
Problem:  A small company needs an interactive program to compute an employee’s paycheck. The payroll clerk will initially input the data, and given the input data, an employee's wage for the week should be displayed on the screen for the payroll check. The data for the employee includes the employee's hourly pay rate and the number of hours worked that week. Wage is equal to the employee's pay rate times the number of hours worked (up to 40 hours). If the employee worked more than 40 hours, wage is equal to the employee's pay rate times 40 hours plus 1½ times the employee's pay rate times the number of hours worked above 40. Instructions: Match the action at the left-side with the correct step number at the right-side (the attached picture). Note that it may be possible to group more than one related actions in the same logical step / process without altering the essence of the algorithm. In the program flow, input and checking of hourly pay rate should come before that of the number…
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
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT