Documente Academic
Documente Profesional
Documente Cultură
Programming
CS 102
1- Put the sliced bread, butter, sliced cheese, knife and plate onto the
workspace.
2- Place two slices of bread on the plate.
3- Using the knife, spread butter on one slice of bread.
4- If you want cheese, place the cheese slices on the buttered slice of bread.
5- Slap two slices of bread together.
6- Repeat steps 2 through 5 for each sandwich needed.
7- Eat sandwiches.
3.1. Get the transaction type (deposit-withdrawal) and amount from the user.
3.2. Get the current balance from the bank.
5.1. If amount is greater than the current balance, construct an error message
and skip to step 6.
5.2. If amount is equal to or less than then current balance, subtarct the amount
from the current balance.
6. Output the error message or the cash, and the current balance.
7. Ask the user whether to repeat steps 3 through 6 for another
transaction.
Do you
want
cheese?
yes
Put cheese on the bread
no
Slap two slices together
yes
Do you
want
another?
no
Eat the sandwich(es)
Get password
Get password
Is the
password
good?
yes
Get type and amount
no
deposit
Deposit or
withdrawal?
Add amount to
current balance
no
withdrawal
yes
Is amount
< balance?
Subtract from
current balance
Get inputs
Perform all
calculations
Give outputs
Get transaction
type
Get inputs
Get password
Get transaction
amount
Perform calculations
Give outputs
Handle
withdrawals
Handle deposits
Print error
message
Print balance
Dispense
charge
Add amount to
balance
Subtract amount
from balance
Check balance
Give error
message
Get inputs
Get password
Get transaction
type
Give outputs
Perform calculations
Get transaction
amount
Print error
message
Dispense
charge
Print balance
Perform calculations
Handle
withdrawals
Handle deposits
Add amount to
balance
Check balance
Subtract amount
from balance
Handle
withdrawals
Handle deposits
Give error
message
Add amount to
balance
Check balance
Subtract amount
from balance
Give error
message