Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var x, y, bnum, updown, font, font2, font3, font4, font5, font6, countras, countap, countmel, countgrap, countorg, countap2, loopcount : int
- countras := 0
- countap := 0
- countmel := 0
- countgrap := 0
- countorg := 0
- countap2 := 0
- loopcount := 0
- font := Font.New ("Arial Black:20:bold")
- font2 := Font.New ("Arial Black:20:bold")
- font3 := Font.New ("Arial Black:20:bold")
- font4 := Font.New ("Arial Black:20:bold")
- font5 := Font.New ("Arial Black:20:bold")
- font6 := Font.New ("Arial Black:20:bold")
- assert font > 0
- loop
- loopcount := loopcount + 1
- locate (2, 30)
- put "Choose your favourite Jolly Rancher flavour"
- drawfillbox (0, 0, 200, 200, 9)
- drawfillbox (200, 0, 400, 200, 10)
- drawfillbox (400, 0, 1000, 200, 12)
- Font.Draw ("Blue Ras.", 18, 85, font, black)
- Font.Draw ("Green Apple", 210, 80, font2, black)
- Font.Draw ("Watermellon", 430, 80, font3, black)
- loop
- buttonwait ("down", x, y, bnum, updown)
- locate (5, 1)
- put " "
- if ((x >= 0 and x <= 200) and (y >= 0 and y <= 200)) then
- put "Blue Rasberry"
- countras := countras + 1
- exit
- elsif ((x >= 201 and x <= 400) and (y >= 0 and y <= 200)) then
- put "Green Apple"
- countap := countap + 1
- exit
- elsif ((x >= 401 and x <= 640) and (y >= 0 and y <= 200)) then
- put "Watermellon"
- countmel := countmel + 1
- exit
- else
- locate (5, 1)
- put "wrong selection"
- end if
- end loop
- cls
- locate (2, 30)
- put "Choose your favourite Juice"
- drawfillbox (0, 0, 200, 200, 5)
- drawfillbox (200, 0, 400, 200, 42)
- drawfillbox (400, 0, 1000, 200, 12)
- Font.Draw ("Grape", 18, 85, font4, black)
- Font.Draw ("Orange", 210, 80, font5, black)
- Font.Draw ("Apple", 430, 80, font6, black)
- loop
- buttonwait ("down", x, y, bnum, updown)
- locate (5, 1)
- put " "
- if ((x >= 0 and x <= 200) and (y >= 0 and y <= 200)) then
- put "Grape"
- countgrap := countgrap + 1
- exit
- elsif ((x >= 201 and x <= 400) and (y >= 0 and y <= 200)) then
- put "Orange"
- countorg := countorg + 1
- exit
- elsif ((x >= 401 and x <= 640) and (y >= 0 and y <= 200)) then
- put "Apple"
- countap2 := countap2 + 1
- exit
- else
- locate (5, 1)
- put "wrong selection"
- end if
- end loop
- cls
- locate (1, 1)
- put "Press anywhere to take survey again"
- put "Press red to exit survey and go to statistics for this trial"
- drawfillbox (200, 0, 400, 200, 12)
- buttonwait ("down", x, y, bnum, updown)
- if ((x >= 201 and x <= 400) and (y >= 0 and y <= 200)) then
- exit
- else
- locate (1, 1)
- put " "
- put " "
- end if
- end loop
- cls
- locate (2, 30)
- put "Statistics"
- put " "
- put " "
- put "Number of people/times the survey was taken:", " ", loopcount
- put "Number of times each option was chosen in the ENTIRE trial..."
- put "Jolly Rancher flavor: Blue Rasberry -", " ", countras
- put "Jolly Rancher flavor: Green Apple -", " ", countap
- put "Jolly Rancher flavor: Watermellon -", " ", countmel
- put "Juice flavor : Grape -", " ", countgrap
- put "Juice flavor : Orange - ", " ", countorg
- put "Juice flavor : Apple - ", " ", countap2
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement