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 2PE
Program Plan Intro

Print a grade for quiz score

Program plan:

  • In the function  “main() ”,
    • Get the input from the user.
    • Check the condition, “y” is equal to “5” using “if” statement,
      • Print a character “A”.
    • Check the condition, “y” is equal to “4” using “if” statement,
      • Print a character “B”.
    • Check the condition, “y” is equal to “3” using “if” statement,
      • Print a character “C”.
    • Check the condition, “y” is equal to “2” using “if” statement,
      • Print a character “D”.
    • Check the condition, “y” is equal to “1” using “if” statement,
      • Print a character “F”.
    • Check the condition, “y” is equal to “0” using “if” statement,
      • Print a character “F”.
    • Otherwise, Print the string “Please enter the quiz score between 0 and 5”.
  • Call the function “main()”.

Blurred answer
Students have asked these similar questions
The Café Noir Coffee Shop wants some market research on its customers. When a customer places an order, a clerk asks for the customer’s zip code and age. The clerk enters that data as well as the number of items the customer orders. The program operates continuously until the clerk enters a 0 for zip code at the end of the day. When the clerk enters an invalid zip code (more than 5 digits) or an invalid age (defined as less than 10 or more than 110), the program reprompts the clerk continuously. When the clerk enters fewer than 1 or more than 12 items, the program reprompts the clerk two more times. If the clerk enters a high value on the third attempt, the program accepts the high value, but if the clerk enters a negative value onthe third attempt, an error message is displayed and the order is not counted. At the end of the program, display a count of the number of items ordered by customers from the same zip code as the coffee shop (54984), and a count from other zip codes. Also…
Write a program that reads student scores, gets the best score, and hence assigns grades based on the following scheme: Grade is A if score is > = best - 10; Grade is B if score is > = best - 20; Grade is C if score is > = best - 30; Grade is D if score is > = best - 40; Grade is F otherwise. The program prompts the user to enter the total number of students, then prompts the user to enter all of the scores, and concludes by displaying the grades. Language: C++
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
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT