Write a program that requires the user to input a binary number and then the program will calculate and output a base 10 number % Harold Rivera % Friday March 21, 2003 % probset3-1.t % write a program that allows the user to input any message and then flashes that message % centered on the screen in all possible colours. var msg:string put "Please enter any message" get msg:* loop for colours:1..256 color(colours) put "" :30, msg delay(100) cls delay(100) end for end loop --- % Develop a program that displays "whos is a genious?" In the middle of the screen % Then waits 2 seconds and displays 30 question marks under who is a genious. Waits 2 seconds % clears the screen and then centers 40 exclamation marks, The users name should % appear centered on the screen after the !!( you must use repition strctures for the % exclamation marks and question marks.) var name:string put "Please enter your name" get name cls put "" :35, "Who is a genious" delay(2000) for yaxis: 1..25 delay(50) locate(yaxis,36) put "?" end for delay(2000) cls for yaxis: 1..25 delay(50) locate(yaxis,36) put "!" end for put "" :33, name ---- % Harold Rivera % Monday March 31, 2003 % probset3-3.t % Write a program that allows the user to input the radius of a cricle and then % draws 20 circles with that radius across the screen. % declares the variable rad as an integer. var rad:int % instructs the user to enter the radius of a circle. put "Please enter the radius of a circle" % instructs the computer to retrieve the inputed information and store it. get rad % instructs the computer to begin a for count from 1 to 20 for count:1..20 % instucts the computer to draw 20 circles based on the inputed radius. drawfilloval(count*28,30,rad,rad,10) % instructs the computer to delay the drawing of each circle for 1/2 second. delay(500) % instructs the computer to end the for statement. end for ---- % Harold Rivera % Monday March 31, 2003 % probset3-4.t % Write a program that draws a circle on the screen with the circumference in blue then % fills the circle alterating with red an black for about 1 min. % instructs the computer to draw drawfilloval(300,200,100,100,9) loop for count:1..55 delay(500) drawfilloval(300,200,95,95,7) delay(500) drawfilloval(300,200,95,95,12) end for end loop ---- var number, trunk, counter:int var remainder: array 1..100 of int counter:=1 put "Please enter any base 10 (decimal) number" get number loop trunk:= number div 2 remainder(counter):= number mod 2 number:=trunk exit when trunk=0 counter:=counter+1 end loop for decreasing counter2: counter..1 put remainder(counter2).. end for ---- var word:string loop put "Hello, please enter any word. To exit the program, type the word " put "tired" put "" get word exit when word="tired" for i: 1..length(word) delay(500) put "" :40, word(i) end for end loop ---- % Write a program that creates three clickable boxes on the screen. When the first box is % clicked on a red circle should appear to the right of the box. When the second box is % clicked the box should disappear. When the third is clicked the program should end. % use a message to indicate that the program is complete * label boxes apporpriatley var xmouse, ymouse, button:int drawfillbox(50,100,100,150,2) drawfillbox(150,200,200,250,4) drawfillbox(250,300,300,350,9) locate(15,8) put "BOX 1" loop mousewhere(xmouse,ymouse,button) if xmouse >=50 and xmouse<=100 and ymouse>=100 and ymouse<=150 and button=1 then drawfilloval(150,130,20,20,red) mousewhere(xmouse,ymouse,button) elsif xmouse >=150 and xmouse<=200 and ymouse>=200 and ymouse<=250 and button=1 then drawfillbox(150,200,200,250,white) mousewhere(xmouse,ymouse,button) else exit when xmouse >=250 and xmouse<=300 and ymouse>=300 and ymouse<=350 and button=1 end if end loop cls put " Program is complete"
Site hosted by Angelfire.com: Build your free website today!