Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /***************************************************************************/
- /* Program that asks the user for their first name, age, school */
- /* and their favourite subject */
- /* 4questions4var.t */
- /* by: Saon Pal */
- /***************************************************************************/
- var firstName : string % the first name input by the user
- var age : int % the age input by the user, cannot be negative
- var school : string % the attended school input by the user
- var favSubject: string % the favourite subject input by the user
- var reply : string(1) % response to press enter to restart
- loop
- put "Question 1/4"
- put "What is your first name? "..
- get firstName
- cls
- put "Question 2/4"
- put "How old are you? "..
- get age
- cls
- put "Question 3/4"
- put "What school do you go to? "..
- get school : *
- cls
- put "Question 4/4"
- put "What is your favourite subject? "..
- get favSubject : *
- cls
- put "--------"..
- put firstName ..
- put "'s Information--------"
- put""
- put "Name : "..
- put firstName
- put "Age : "..
- put age
- put "School : "..
- put school
- put "Favourite Subject : "..
- put favSubject
- put""
- put "------Press any key to restart------"
- getch (reply) % pauses execution until a key is pressed
- cls
- end loop
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement