project 2 for IT programming

in #python7 years ago

this is the second program for my IT class, the reason there is no flowchart for the second code is because the only difference in code is the try and except variables

pseudocode: 1
start
call function to main.
Define hours as floating integer
display input request for how many hours worked.
assign variable for number of hours worked.
If hours worked is greater than 40 assign overtime pay as hours worked minus 40 multiplied by 15
Assign total pay as regular pay plus overtime pay
Else hours worked is less than 40
Then regular pay is hours worked multiplied by ten
Overtime pay would be zero and total pay is the same as regular pay
Print you earned (output of regular pay) in regular pay hours is greater than 40
Print you earned (output of overtime pay) in overtime pay
Print you earned (output of total pay) in overtime pay
End

Flowchart 1:

flow 1.png

Code 1:

code 1.png

Output 1:

output  1.png

Pseudocode: 2

start

try
call function to main.
Define hours as floating integer
display input request for how many hours worked.
assign variable for number of hours worked.
If hours worked is greater than 40 assign overtime pay as hours worked minus 40 multiplied by 15
Assign total pay as regular pay plus overtime pay
Else hours worked is less than 40
Then regular pay is hours worked multiplied by ten
Overtime pay would be zero and total pay is the same as regular pay
Print you earned (output of regular pay) in regular pay hours is greater than 40
Print you earned (output of overtime pay) in overtime pay
Print you earned (output of total pay) in overtime pay
Except if input is not right print error message “this is not a valid number’
End

Code 2:

code 2.png

Output 2:

output 2.png

Pseudocode 3

Start
Call function to main
display input for number of grade received
assign variable of integer as letter grade it is equal to
if number grade is greater than or equal to 90 and number grade is less than or equal to 100
print result of variable assigned as your number grade is A
else if number grade is greater than or equal to 80 and number grade is less than 90
print result of variable assigned as your number grade is B
else if number grade is greater than or equal to 70 and number grade is less than 80
print result of variable assigned as your number grade is C
else if number grade is greater than or equal to 60 and number grade is less than 70
print result of variable assigned as your number grade is C
else print result variable your letter grade is F
print result of input as number and letter grade defines
call function to main

end program

Flowchart 3:

flowchart 3.png

Code 3:

code 3.png

Output 3:

output 3.png

Coin Marketplace

STEEM 0.28
TRX 0.21
JST 0.039
BTC 97208.32
ETH 3709.85
USDT 1.00
SBD 3.93