python for everybody chapter 4.6 assignment

Assignment 4.6 | Week-6 | Programming for Everybody (Getting Started with Python) By Coursera

Assignment 4.6 | Week-6 | Programming for Everybody (Getting Started with Python) By Coursera

Coursera Programming for Everybody (Getting Started with Python) Week 6  Assignment 4.6 

 Question:      4.6 Write a program to prompt the user for hours and rate per hour using input to compute gross pay. Pay should be the normal rate for hours up to 40 and time-and-a-half for the hourly rate for all hours worked above 40 hours. Put the logic to do the computation of pay in a function called computepay() and use the function to do the computation. The function should return a value. Use 45 hours and a rate of 10.50 per hour to test the program (the pay should be 498.75). You should use input to read a string and float() to convert the string to a number. Do not worry about error checking the user input unless you want to – you can assume the user types numbers properly. Do not name your variable sum or use the sum() function.

Assignment 4.6 | Week-6 | Programming for Everybody (Getting Started with Python) By Coursera

Do Not Only Use These Quizzes For Getting Certificates.You Can Take Help From These Quizzes Answer. All Quizzes & Contents Are Free Of Charge. ✅ If You Want Any Quiz Answers Then Please  Contact Us

Related Questions & Answers:

  • Programming for Everybody (Getting Started with Python) – Coursera Quiz Answers Programming for Everybody (Getting Started with Python) – Coursera 4.8 Stars (167,402 ratings)   Instructor: Charles Russell Severance Enroll Now   This Programming ... Read more...
  • Assignment: Write Hello World | Week-3 | Programming for Everybody (Getting Started with Python) By Coursera   Coursera Programming for Everybody (Getting Started with Python) Week 3  Assignment: Write Hello World   Question:  Write a program that uses ... Read more...
  • Assignment 5.2 | Week-7 | Programming for Everybody (Getting Started with Python) By Coursera    Coursera Programming for Everybody (Getting Started with Python) Week 5  Assignment 5.2   Question:  5.2 Write a program that repeatedly prompts ... Read more...
  • Assignment 3.3 | Week-5 | Programming for Everybody (Getting Started with Python) By Coursera    Coursera Programming for Everybody (Getting Started with Python) Week 5  Assignment 3.3   Question:  3.3 Write a program to prompt for a ... Read more...
  • Assignment 3.1 | Week-5 | Programming for Everybody (Getting Started with Python) By Coursera Coursera Programming for Everybody (Getting Started with Python) Week 5  Assignment 3.1   Question:  3.1 Write a program to prompt the user ... Read more...
  • Chapter 1 (Quiz Answers) | Week-3 | Programming for Everybody (Getting Started with Python) By Coursera Coursera Programming for Everybody (Getting Started with Python) Week 3 Chapter 1 Graded Quiz • 30 min 1. When Python ... Read more...

Leave a Comment Cancel reply

Save my name, email, and website in this browser for the next time I comment.

Instantly share code, notes, and snippets.

@acmarsnik

acmarsnik / py4e-pfe-4_6-computePayV4.py

  • Download ZIP
  • Star ( 0 ) 0 You must be signed in to star a gist
  • Fork ( 0 ) 0 You must be signed in to fork a gist
  • Embed Embed this gist in your website.
  • Share Copy sharable link for this gist.
  • Clone via HTTPS Clone using the web URL.
  • Learn more about clone URLs
  • Save acmarsnik/46398ce33f559545c03ab51f58dbe2a4 to your computer and use it in GitHub Desktop.

@acmarsnik

acmarsnik commented Nov 19, 2017

Write a program to prompt the user for hours and rate per hour to compute gross pay.

Sorry, something went wrong.

Desired Prompt 1: Enter Hours: Example Input 1: 35 Desired Prompt 2: Enter Rate: Example Input 2: 2.75 Desired Output: Pay: 96.25

We won't worry about making sure our pay has exactly two digits after the decimal place for now. If you want, you can play with the built-in Python round function to properly round the resulting pay to two decimal places.

Rewrite your pay computation to give the employee 1.5 times the hourly rate for hours worked above 40 hours.

acmarsnik commented Nov 19, 2017 • edited Loading

Rewrite your pay program using try and except so that your program handles non-numeric input gracefully by printing a message and exiting the program. The following shows two executions of the program:

Enter Hours: 20 Enter Rate: nine Error, please enter numeric input

Enter Hours: forty Error, please enter numeric input

Rewrite your pay computation with time-and-a-half for overtime and create a function called computepay which takes two parameters (hours and rate).

IMAGES

  1. Coursera

    python for everybody chapter 4.6 assignment

  2. Programming for Everybody (Getting Started with Python) ||Week 6 || Assignment 4.6 Coursera

    python for everybody chapter 4.6 assignment

  3. Coursera: Python For Everybody Assignment 4.6 program solution

    python for everybody chapter 4.6 assignment

  4. "Python for Everybody" Chapter 4

    python for everybody chapter 4.6 assignment

  5. 【Python for Everybody(Getting Started with Python)】Week 6

    python for everybody chapter 4.6 assignment

  6. 【Python for Everybody(Getting Started with Python)】Week 6

    python for everybody chapter 4.6 assignment

COMMENTS

  1. python-for-everybody/wk4

    Class notes. Contribute to ed-lau/python-for-everybody development by creating an account on GitHub.

  2. assignment_4_6.py

    #4.6 Write a program to prompt the user for hours and rate per hour using input to compute gross pay. #Award time-and-a-half for the hourly rate for all hours worked above 40 hours. #Put the logic to do the computation of time-and-a-half in a function called computepay() #and use the function to do ...

  3. Assignment 4.6

    CourseraProgramming for Everybody (Getting Started with Python)Week 6 Assignment 4.6 Question: 4.6 Write a program to prompt the user for hours and rate per hour using input to compute gross pay. Pay should be the normal rate for hours up to 40 and time-and-a-half for the hourly rate for all hours worked above…

  4. Python for everybody

    Python for everybody - Assignment 4.6. GitHub Gist: instantly share code, notes, and snippets. Python for everybody - Assignment 4.6. ... There are indentations in this code: if, else and returned must be aligned; pay, pay must also be aligned. If using python 3, hit the tab key once, which should place if right between f in def and space and c ...

  5. Python-for-Everybody-Coursera/Programming for Everybody/Chapter 4

    Coursera courses for the Python for Everybody Specialization. - atse0612/Python-for-Everybody-Coursera

  6. Python For everybody Assignment 4.6 · GitHub

    Python For everybody Assignment 4.6 Raw. Assignment 4.6. Py This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters ...

  7. Python For Everybody Specialization, Programming for Everybody (Getting

    Python For Everybody Specialization, Programming for Everybody (Getting Started with Python), Assignment 4.6: Compute Pay V4 - py4e-pfe-4_6-computePayV4.py

  8. Coursera Python for Everybody EP-11

    Hi guys, in this video I solved the assignment 4.6 of Coursera Python for Everybody. Hope you find it useful.If you're new, Subscribe! https://www.youtube....

  9. Python For Everybody Assignment 4.6 program solution

    Coursera: Python For Everybody Assignment 4.6 program solution | Assignment 4.6 Python For EverybodyQ.) 4.6 Write a program to prompt the user for hours and ...

  10. Coursera

    Coursera| Programming For Everybody Assignment 4.6 program solution Answer | Python for Everybody Assignment 4.6 program solution