CSC 171 - Introduction to Computer Programming
Lab Assignment #5 - Non-binary Decisions Non-binary Decisions
Due Thursday, September 14, 2023
We can create non-binary decisions by using
if-elif-else
We can also specify this pseudocode:
IF x < 0
THEN print “Negative”
ELSE IF x > 0
THEN Print “Positive”
ELSE Print “Zero”
You are going to write a program where you will be asked to enter a weekly salary:
- If the salary is $1000 or more, your tax rate is 8%.
- If the salary is $600 or more but less than $1000, your tax rate is 6%.
- If the salary is $400 or more but less than $600, your tax rate is 4%.
- If the salary is less than $400, your tax rate is 0%
Write pseudocode for the program, draw a flow chart for the program and then
write the program.
[Back to the Lab Assignment List]
|