Question #37597

Write an algorithm and create a flowchart which simulate the testing for cell phone PIN. If the user entered the correct pin code, display “Welcome to DLM Telecom”. The cell phone user will enter his pin code three times; if on third try he fails to enter the correct pin code, display “Invalid Pin Code”. Thereafter, the program will prompt the user to enter PUK secret code for three times also. If the user still fails to enter PUK code after three tries, display “SIM BLOCKED” (PIN= 0123 & PUK = 1234)

Expert's answer

Answer on Question #37597- Programming- Other

Description of variables:

Count – quantity of entered PIN Code tries

Count1 – quantity of entered PUK Code tries

CorrectPINExit – flag, indicate correctly entered PIN Code

PUKExit – flag, indicate correctly entered PUK Code

Description of flowchart:

p1. First time initialization of variables Count, Count1, CorrectPINExit

p2. We are entering PIN Code

p3. Compare PIN Code with "0123". IF PIN Code entered correctly, we are going to p4, else to p5

p4. Set CorrectPINExit to true, i.e. PIN Code entered correctly

p5. Add 1 to quantity of entered PIN Code tries

p6. Compare Count with 3. IF Count=3 then go to p7, else pass this fragment of PUK Code Enter

p7. Display "Invalid PIN Code"

p8. Reset Count to 0, Initialisation Count1, set PUKExit to false

p9. We are entering PUK Code

p10. Compare PUK Code with 1234. IF PUK Code entered correctly, we are going to p11, else to p12

p11. Set PUKExit to true, i.e. PUK Code entered correctly

p12. Add 1 to quantity of entered PUK Code tries

p13. Compare Count1 with 3. IF Count1=3 or PUKExit is true, then go to p14, else return to PUK Code Enter

p14. IF Count1=3 or PIN Code entered correctly, then go to p15, else return to PIN Code Enter

p15. Look the value of CorrectPINExit. IF PIN Code entered correctly, then go to p16, else to p17

p16. Display "Welcome to DLM Telecom"

p17. Display "SIM Blocked"

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

LATEST TUTORIALS
APPROVED BY CLIENTS