Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- LET Repeat$="Yes"
- DO While Repeat$= "Yes"
- PRINT
- PRINT "Choose which option you would like to see"
- PRINT "1-Square"
- PRINT "2-Square Root"
- PRINT "3-Sum of all numbers"
- PRINT "4-Number of perfect squares"
- PRINT "Type in the number of the option you would like to see"
- INPUT Choice
- IF Choice =1 then CALL Square
- IF Choice =2 then CALL SquareRoot
- IF Choice =3 then CALL SumOfAllNumbers
- IF Choice =4 then CALL NumberOfPerfectSquares
- PRINT
- INPUT prompt "Would you like to restart the program? ":Repeat$
- LOOP
- !__________________________________________________________
- SUB Square
- PRINT "The List of Squares"
- FOR Number= 1 to 20
- PRINT Number;TAB(6);Number^2
- NEXT number
- END SUB
- !__________________________________________________________
- SUB SquareRoot
- PRINT "The List of Squares Roots"
- FOR Number= 1 to 20
- PRINT Number;TAB(6);Sqr(Number)
- NEXT number
- END SUB
- !__________________________________________________________
- SUB SumOfAllNumbers
- FOR Number= 1 to 20
- LET Total=Total+Number
- NEXT number
- PRINT "The sum of all the numbers is";Total
- END SUB
- !__________________________________________________________
- SUB NumberOfPerfectSquares
- FOR Number= 1 to 20
- LET Root=Sqr(Number)
- IF Root= IP(Root) Then LET CountR=CountR+1
- NEXT number
- PRINT "There are";CountR;"perfect square"
- END SUB
- !__________________________________________________________
- END
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement