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

bartleby

Videos

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

Calculate and printing wages for the week

Program plan:

  • In the function  “main()”, check the condition for negative value using “while” loop,
    • Create a “try” block to find and raise the exception,
      • Get the inputs from the user.
    • Catch and handle the exception in corresponding “except” block.
    • Check the condition, “x” is less than or equal to “40” using “if” statement,
      • Calculate the wage for the week if the condition is “True”.
    • Otherwise,
      • Calculate the total wages for the week with the help of wages calculated for “40” hours.
  • Call the function “main()”.

Blurred answer
Students have asked these similar questions
In many sports events, contestants are rated by judges with an average score being determined by discarding the highest and lowest scores and averaging the remaining scores. Write a program in which eight scores are entered, computing the average score for the contestants.
A retail store grants its customers a maximum amount of credit. Each customer’s available credit is his or her maximum amount of credit minus the amount of credit used. Write a program that asks for a customer’s maximum amount of credit and then asks for the amount of credit used. The program should then properly display the customer’s available credit.
The current year and the year in which employee joined  the organization are entered through keyboard. If  number of years employee serve in organization is more than or equal to 3, then the bonus of the 30%  of the basic salary is given to employee. Write a program to display bonus given to employee.
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++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Constants, Variables, Data types, Keywords in C Programming Language Tutorial; Author: LearningLad;https://www.youtube.com/watch?v=d7tdL-ZEWdE;License: Standard YouTube License, CC-BY