Python Programming: An Introduction to Computer Science
Python Programming: An Introduction to Computer Science
3rd Edition
ISBN: 9781590282779
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
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…
One Computer Science program uses the following rules for CS course placement: 1. if the CS AP score is 4 or higher, a student is placed to CS 221, 2. If the CS AP score is less than 4 (0 means no AP) and the ACT math is 24 or higher, a studenet is placed to CS 180, 3. If the CS AP score is less than 4 and the ACT math is lower than 24, a student is placed to CS 170. Write a java program that can print the appropriate courses for each of three cases. A sample output is the following 525 CS221 325 CS180 0 20 CS170 where the first and second colomn are the socre of the AP couse and ACT math, respectively. You must use if-else statement in the code since there exists logical relations between the three cases For example, case 2 and case 3 are both "else" cases with respect to case 1 Remember to comment your code, and follow the Java naming convention.
computer programming (C) language
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