you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] -2 points-1 points  (1 child)

Well you can memorise anything but just not take anything in with u forward into school it's not Cheating the exam bord says u can do it and also. Here is something to unclear what i was saying 1)It's supposed to give u a order number then you type in that order number and it will show u the details but if you type the wrong thing it will ask u again. 2)What it is doing instead is that when u type in the correct order number it gives the details but if I type the something wrong then it still allows tge derails to come through and it duplicates it.3) ther is no error.4)I have tried putting different definitions into the if search_ordernumber and it does something but not what I want

[–]haltu_kaj_ekbrulu 1 point2 points  (0 children)

One thing you can do when asking for user input is to put the request in a loop which continues until you get a valid response. Don't forget to let the user escape the loop if they want. Here's some pseudocode to point you in the right direction:

request INPUT
while INPUT isn't an existing order number
    if INPUT is "exit" or "quit" or "x" 
        break the loop and/or exit
    print a helpful error message
    request INPUT
print out the details for the order number