Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Python for Everybody 3.1 assignment
#1
Hi
I need help please
I tried and did not succeed
İmage
Quote
#2
You never print the pay. Give that a try.

Also - please don't post a screenshot of code again, post using code tags - https://python-forum.io/misc.php?action=help&hid=25
Generally, we strongly prefer text to screenshots.
Quote
#3
I did not understand what was required
So I asked for help
Quote
#4
use print to print the pay result
Quote
#5
My friend how I will reach output 498.75
What is the calculation of each asset to this output?

inp = input ("Enter Hours: ")
hours = float(inp)
inp = input("Enter Rate: ")
rate = float(inp)
if hours <=40 :
    pay = rate * hours
else :
    pay = rate * 40 + ( rate * 1.5 * (hors - 40) )
print("pay")
micseydel wrote Jan-05-2019, 04:09 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button.
Quote
#6
As I said before, use code tags when posting code. See the link I provided before if you're unsure how.

Your calculation is correct, but you have two other bugs in your program. The first is that you misspelled hours on line 8. Have you tested your code? I highly recommend doing so before making posts online about it. The second bug is that on your last line, you have quotes around "pay" when you should not.
Quote
#7
I am sorry my friend
I am a beginner
I do not understand
Help me write the code

İmage



I have tested the code on Pycharm
I do not know what to put in order to get the output 498.75
Quote
#8
This should do the trick. Input 45 gives 498.75.
hours = float(input("Enter hours: "))
rate = 10.5
ratePlus = 10.5 * 1.5

if hours > 40:
    pay = 40 * rate + (hours - 40) * ratePlus

else:
    pay = hours * rate

print (pay)

ramadan2099 likes this post
Quote
#9
(Jan-06-2019, 06:24 PM)Mr_W Wrote: This should do the trick. Input 45 gives 498.75.
hours = float(input("Enter hours: "))
rate = 10.5
ratePlus = 10.5 * 1.5

if hours > 40:
    pay = 40 * rate + (hours - 40) * ratePlus

else:
    pay = hours * rate

print (pay)


http://www9.0zz0.com/2019/01/07/00/601889633.png
look my friend
Quote
#10
Looks like you're supposed to get the hourly rate as well, not hard-code it.
ramadan2099 likes this post
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  [split] Python for Everybody 5.2 assignment jonchanzw 2 126 Jun-14-2019, 09:45 PM
Last Post: nilamo
  assignment help sammmy 4 205 Jun-11-2019, 06:17 PM
Last Post: micseydel
  Write pseudo code for a class assignment Scrimshot 3 245 May-07-2019, 05:38 PM
Last Post: Scrimshot
  Need help with my assignment please - game of Solitaire Muzz 2 291 Apr-09-2019, 03:48 PM
Last Post: Muzz
  [split] University Assignment Help needed Nomathemba 2 169 Apr-07-2019, 11:49 PM
Last Post: micseydel
  Powerball assignment, how to get correct output of a dictionary ? msp1981 5 240 Mar-19-2019, 11:02 PM
Last Post: Yoriz
  Help with homework assignment grayarea3 1 315 Feb-20-2019, 10:10 PM
Last Post: ichabod801
  Help with assignment dxfrelince 7 458 Feb-18-2019, 09:16 PM
Last Post: dxfrelince
  Need help with a tough school assignment datson79 5 339 Feb-18-2019, 06:01 PM
Last Post: ichabod801
  Need some help with a bit of code for an assignment. JackMercer50 1 224 Feb-09-2019, 04:13 PM
Last Post: stullis

Forum Jump:


Users browsing this thread: 1 Guest(s)