Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions Assignments/Assignment_3.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
Hello Fellows!

Write a program to prompt the user for hours and rate per hour using raw_input to compute gross pay.
Pay the hourly rate for the hours up to 40 and 1.5 times the hourly rate for all hours worked above 40 hours.
Use 45 hours and a rate of 10.50 per hour to test the program (the pay should be 498.75).
You should use raw_input to read a string and float() to convert the string to a number.


Do not worry about error checking the user input - assume the user types numbers properly.

Please begin writing the program with the code below:
hrs = raw_input("Enter Hours:")
h = float(hrs)



Happy Coding,
Tunisia


In courtesy of Coursera.
23 changes: 23 additions & 0 deletions Assignments/Assignment_3.3
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
Hello Fellows!

Write a program to prompt for a score between 0.0 and 1.0.
If the score is out of range, print an error. If the score is between 0.0 and 1.0, print a grade using the following table:

Score Grade
>= 0.9 A
>= 0.8 B
>= 0.7 C
>= 0.6 D
< 0.6 F

If the user enters a value out of range, print a suitable error message and exit. For the test, enter a score of 0.85.

Please begin writing the program with the code below:
score = raw_input("Enter Score: ")


Happy Coding,
Tunisia


In courtesy of Coursera.
22 changes: 22 additions & 0 deletions Assignments/Assignment_4.6
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
Hello Fellows!

Write a program to prompt the user for hours and rate per hour using raw_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 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 raw_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.

Begin writing the program with the code below:
def computepay(h,r):
return 42.37

hrs = raw_input("Enter Hours:")
p = computepay(10,20)
print "Pay",p



Happy Coding,
Tunisia
File renamed without changes.
Binary file added Slides/03-29-16-Expressions.pdf
Binary file not shown.
Binary file added Slides/04-05-16-Conditional.pdf
Binary file not shown.
Binary file added Slides/04-07-16-Functions.pdf
Binary file not shown.
Binary file added Slides/04-11-16-Iterations.pdf
Binary file not shown.