[HELP] ATM algorithm and pseudo-code.
Nov 4, 2018 at 6:14pm UTC
Write your question here.
Hey folks,
I've just started a CS class, and i need help with this material.
I accept any feedback and advice to complete this assessment.
[Tasks]
https://imgur.com/a/jwHrmhR
What I did so far:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
Task 1 – Problem Decomposition
a)
b)
PROGRAM <ATM_WITHDRAWAL>
1. DISPLAY 'Enter amount to withdraw’;
2. INPUT amount;
3. READ balance;
4. dispense cash amount;
5. balance = balance – amount;
6. DISPLAY ' Your balance is’, balance;
END
Task 2
PROGRAM <ATM_WITHDRAWAL>
1. IF card inserted
2. DISPLAY 'Enter amount to withdraw’;
3. INPUT amount;
4. READ balance;
5. dispense cash amount;
6. balance = balance – amount;
7. DISPLAY ' Your balance is’, balance;
8. ENDIF
END
Task 3
a)
DECLARE integer correctPIN ;
DECLARE integer pin;
b)
PROGRAM <ATM_WITHDRAWAL>
1. DECLARE boolean valid ;
2. DECLARE integer correctPIN ;
3. DECLARE integer pin;
4. SET valid = false ;
5. IF card inserted
6. DO
DISPLAY ‘Enter your PIN’;
INPUT pin;
READ correctPIN;
IF pin = correctPIN
valid = true ;
ENDIF
7. WHILE valid = false ;
8. ENDIF
9. DISPLAY 'Enter amount to withdraw’;
10. INPUT amount;
11. READ balance;
12. dispense cash amount;
13. balance = balance – amount;
14. DISPLAY ' Your balance is’, balance;
Topic archived. No new replies allowed.