Advertisement
Guest User

Untitled

a guest
Feb 11th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.57 KB | None | 0 0
  1. /***************************************************************************/
  2. /* Program that asks the user for their first name, age, school */
  3. /* and their favourite subject */
  4. /* 4questions4var.t */
  5. /* by: Saon Pal */
  6. /***************************************************************************/
  7.  
  8. var firstName : string % the first name input by the user
  9. var age : int % the age input by the user, cannot be negative
  10. var school : string % the attended school input by the user
  11. var favSubject: string % the favourite subject input by the user
  12. var reply : string(1) % response to press enter to restart
  13.  
  14.  
  15. loop
  16. put "Question 1/4"
  17. put "What is your first name? "..
  18. get firstName
  19. cls
  20. put "Question 2/4"
  21. put "How old are you? "..
  22. get age
  23. cls
  24. put "Question 3/4"
  25. put "What school do you go to? "..
  26. get school : *
  27. cls
  28. put "Question 4/4"
  29. put "What is your favourite subject? "..
  30. get favSubject : *
  31. cls
  32. put "--------"..
  33. put firstName ..
  34. put "'s Information--------"
  35. put""
  36. put "Name : "..
  37. put firstName
  38. put "Age : "..
  39. put age
  40. put "School : "..
  41. put school
  42. put "Favourite Subject : "..
  43. put favSubject
  44. put""
  45. put "------Press any key to restart------"
  46. getch (reply) % pauses execution until a key is pressed
  47. cls
  48. end loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement