Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Grade 10 ISU!!!!!!
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Mike123




PostPosted: Sat Jan 24, 2009 11:13 am   Post subject: Grade 10 ISU!!!!!!

THIS USER POSTED STOLEN CODE
For the real author and topic see http://compsci.ca/v3/viewtopic.php?t=2556

This was my grade 10 ISU for TIK201. Enjoy!!!!!!



(Singh,Michael) Grade 10 Turing Project.t
 Description:

Download
 Filename:  (Singh,Michael) Grade 10 Turing Project.t
 Filesize:  38.63 KB
 Downloaded:  620 Time(s)

Sponsor
Sponsor
Sponsor
sponsor
saltpro15




PostPosted: Sat Jan 24, 2009 11:53 am   Post subject: RE:Grade 10 ISU!!!!!!

hitting 6 was trippy Razz, cool program
Mike123




PostPosted: Sat Jan 24, 2009 1:50 pm   Post subject: RE:Grade 10 ISU!!!!!!

This is my first program!!!!XD
Mike123




PostPosted: Sat Jan 24, 2009 1:53 pm   Post subject: Re: Grade 10 ISU!!!!!!

THIS USER POSTED STOLEN CODE
For the real author and topic see http://compsci.ca/v3/viewtopic.php?t=2556

Here is the code if you don't want to download it!!
Turing:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Created By: Michael Singh, TIK201             Programming Project 1                                            %
%You have been hired by an educational company to create computer program in Turing for specific subject areas.  %
%The company has offered its employees a bonus incentive for original program development menus.                 %
%The company requires you to create a page menu containing at least three different subject menu items.          %
%Each item must represent different subject area content.                                                        %
%Examples:                                                                                                       %
%Math - Calculating the area and/or perimeter of a geometric figure.                                             %
%Physics - Converting astronomical units to miles or kilometres.                                                 %
%Biology - Health assessment based on the number of red blood cell count.                                        %
%Fashion Arts - Draping ability assessment of fabric by thread count.                                            %
%In addition, all assignments must include the following:                                                        %
%1.      Copy of the re-statement of the project as you understand it.                                           %
%Assignment due date: January 9, 2009            Drop-off folder                                                 %
%2.      Structure diagram.                                                                                      %
%3.       Printed copy of the source code                                                                        %
%4.       Sample run of the program.                                                                             %
%5.      Cover page.                                                                                             %
%6.      Comments:                                                                                               %
%a)      from a programmer's perspective (1/2 a page).                                                           %
%       "What works "                                                                                            %
%       "What does not work "                                                                                    %
%       "Possible areas of expansion   "                                                                         %
%                                                                                                                %
%Due date: January 18, 2009.                                                                                     %                                                                                                      %
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
var win := Window.Open ("graphics:max;max,nobuttonbar")
%Title Page
var finished : boolean := false
% Displays author's information and etc.
var intfont : int
% declare font type and size
intfont := Font.New ("Times New Roman:23")
%displays the text that the user will see
%Title
Draw.Text ("Welcome to Michael's Homework Assistant!!!!!", maxx - 1000, maxy - 30, Font.New ("serif:32:bold"), 40)
Font.Draw ("Hello, Welcome to Michael's Homework Assistant!!!!!", 0, 155, intfont, green)
Font.Draw ("Created by: Michael Singh", 0, 125, intfont, blue)
Font.Draw ("TIK201, January 18,2009", 0, 100, intfont, green)
Font.Draw ("For:Mr.Cheweiscenwik", 0, 75, intfont, red)
for x : 0 .. 100 by 5
    for y : 0 .. 100 by 5
        drawoval (320, 540, x, y, blue)
        delay (5)
    end for
end for
var circleradius, eyerad : int
var gapl, gapr : int
%===============================================================================================
var x : int
var y : int
circleradius := 30
eyerad := circleradius div 7
gapl := circleradius div 3
gapr := circleradius div 10
%===============================================================================================
proc face (x, y, sz, col : int)
    const eyerad := sz div 7
    const gap1 := sz div 3
    const gap2 := 2 * sz div 5

    drawfilloval (x, y, sz, sz, col)
    drawoval (x, y, sz, sz, black)
    drawfilloval (x - gap2, y + gapl, eyerad, eyerad, black)
    drawfilloval (x + gap2, y + gapl, eyerad, eyerad, black)
    drawarc (x, y, 3 * sz div 4, 3 * sz div 4, 200, 340, black)
    for decreasing i : eyerad .. 1
        drawoval (x + gap2, y + gapl, eyerad, i, yellow)
    end for
    for i : 1 .. eyerad
        drawoval (x + gap2, y + gapl, eyerad, i, black)
    end for
end face

for count2 : 1 .. 999
    %============================================================================================
    randint (circleradius, 10, 55)
    randint (x, circleradius, maxx - circleradius)
    randint (y, circleradius, maxy - circleradius)

    %=============================================================================================
    face (x, y, circleradius, yellow)
end for
%delays next function
delay (50)
%delays next function
delay (140)
setscreen ("graphics:max;max")
View.Set ("offscreenonly")
delay (50)
for i : 1 .. 1000 %Canadian flag
    cls
    Draw.Text ("Created for:Mr.Cheweiscenwik (TIK201-10, January 18,2009)", maxx - 900, maxy - 30, Font.New ("serif:22:bold"), 40)
    drawfillbox (0, 0, i * 2, i * 4, 4)
    drawfillmapleleaf (i * 3, 0, i * 7, i * 4, 4)
    drawfillbox (i * 8, 0, i * 10, i * 4, 4)
    exit when (i) * 10 > maxx
    View.Update
end for
delay (1800)
%clears the screen
cls
var win2 := Window.Open ("graphics:max;max,nobuttonbar")
% declares the variable firstname
var firstname : string
var option : int
%Introduction
colorback (82)
put "Hello, welome to Michael's homework assistant!!!"
%Prompt user for name
colorback (84)
put "Please enter your name"
colorback (86)
get firstname
colorback (87)
put ""
colorback (94)
put " ##     ## ######## ##       ##        #######"
colorback (97)
put " ##     ## ##       ##       ##       ##     ## "
colorback (95)
put " ##     ## ##       ##       ##       ##     ## "
colorback (92)
put " ######### ######   ##       ##       ##     ##   "
colorback (90)
put " ##     ## ##       ##       ##       ##     ##    "
put " ##     ## ##       ##       ##       ##     ## "
put " ##     ## ######## ######## ########  #######  "
put ""
put "Hello", " ", firstname, " ", ",what do you need help with today? "
delay (2000)
cls

var choice := 1 or 2 or 3
proc menu1 ()
    var count : int := 0
    loop
        for y : 0 .. maxy by 25
            for x : 0 .. maxx by 25
                if whatdotcolor (x + 5, y + 5) not= 7 then
                    count += 1
                    drawfillbox (x, y, x + 25, y + 25, Rand.Int (1, 16))
                end if
            end for
        end for
        exit when count = 0
        count := 0
    end loop
    cls
    var option4 : int
    put "           ######## ##    ##  ######   ##       ####  ######  ##     ## "
    put "           ##       ###   ## ##    ##  ##        ##  ##    ## ##     ##"
    put "           ##       ####  ## ##        ##        ##  ##       ##     ## "
    put "           ######   ## ## ## ##   #### ##        ##   ######  #########"
    put "           ##       ##  #### ##    ##  ##        ##        ## ##     ## "
    put "           ##       ##   ### ##    ##  ##        ##  ##    ## ##     ## "
    put "           ######## ##    ##  ######   ######## ####  ######  ##     ## "
    put "           ---------------------------------------------------------------"
    put ""
    put "If you would like to calculate the amount letters in a inputed text than press 1."
    put "If you would like to count the number of words in a text than press 2."
    get option4
    case option4 of
        label 1 :
            cls                %Clears the screen
            put "           ######## ##    ##  ######   ##       ####  ######  ##     ## "
            put "           ##       ###   ## ##    ##  ##        ##  ##    ## ##     ##"
            put "           ##       ####  ## ##        ##        ##  ##       ##     ## "
            put "           ######   ## ## ## ##   #### ##        ##   ######  #########"
            put "           ##       ##  #### ##    ##  ##        ##        ## ##     ## "
            put "           ##       ##   ### ##    ##  ##        ##  ##    ## ##     ## "
            put "           ######## ##    ##  ######   ######## ####  ######  ##     ## "
            put "           ---------------------------------------------------------------"
            put ""
            % The "WordLengths" program
            % Read words and find their length
            put "Enter one word to line, end with 'end' "
            var word : string
            put "Enter end to exit this program and return to the main menu"
            loop
                colorback (96)
                put "Enter word: " ..
                colorback (95)
                get word
                exit when word = "end"
                put word, " has ", length (word), " letters"
            end loop

        label 2 :
            cls                            %Clears the screen
            put "           ######## ##    ##  ######   ##       ####  ######  ##     ## "
            put "           ##       ###   ## ##    ##  ##        ##  ##    ## ##     ##"
            put "           ##       ####  ## ##        ##        ##  ##       ##     ## "
            put "           ######   ## ## ## ##   #### ##        ##   ######  #########"
            put "           ##       ##  #### ##    ##  ##        ##        ## ##     ## "
            put "           ##       ##   ### ##    ##  ##        ##  ##    ## ##     ## "
            put "           ######## ##    ##  ######   ######## ####  ######  ##     ## "
            put "           ---------------------------------------------------------------"
            put ""
            % The "WordCount" program
            % Counts the number of words in a text
            var count2 : int := 0
            var word : string
            put "Enter stop to exit the program and return to the main menu."
            loop
                get word
                colorback (95)
                count2 := count2 + 1
                exit when word = "stop"
            end loop
            put "There are ", count2, " words in the text"
            delay (1800)
    end case
end menu1

proc menu2 ()
    colorback (black)
    cls
    color (yellow)
    var colr : int := 32
    for a : -maxy .. maxy
        if colr < 55 then
            colr += 1
        else
            colr := 32
        end if
        drawarc (maxx div 2, a - 25, maxx div 2, maxy, 0, 180, black)
        drawarc (maxx div 2, a, maxx div 2, maxy, 0, 180, colr)
        delay (5)
    end for
    color (1)
    cls
    colorback (93)
    put "                               *    * *****  ******** *   *"
    put "                               **  ** *   *      *    *   *"
    put "                               * ** * *****      *    *****"
    put "                               *    * *   *      *    *   *"
    put "                               *    * *   *      *    *   *"
    put "                               -----------------------------"
    put ""
    colorback (94)
    put "If you would like to calculate the area of a circle press 1."
    put "If you would like to calculate the average of a series of marks than press 2."
    put "If you  would like to calculate the roots of a quadratic formula than press 3."
    put "If you would like to calculate the amount a prime numbers in a range than press 4."
    put "If you would like to graph a parabola or quadratic equation than press 5."
    var option2 : int
    get option2
    case option2 of
        label 1 :
            cls                    %Clears the screen
            put "                               *    * *****  ******** *   *"
            put "                               **  ** *   *      *    *   *"
            put "                               * ** * *****      *    *****"
            put "                               *    * *   *      *    *   *"
            put "                               *    * *   *      *    *   *"
            put "                               -----------------------------"
            put ""
            % Computes circle areas until you enter a negative radius
            var radius, area : real
            const pi := 3.14159
            put "Enter a negative radius to stop execution and return to the main menu"
            loop
                put "Enter radius " ..
                colorback (95)
                get radius
                exit when radius < 0
                area := pi * radius ** 2
                put "Area is ", area
            end loop
            put "That's all folks"
        label 2 :
            cls             %Clears the screen
            put "                               *    * *****  ******** *   *"
            put "                               **  ** *   *      *    *   *"
            put "                               * ** * *****      *    *****"
            put "                               *    * *   *      *    *   *"
            put "                               *    * *   *      *    *   *"
            put "                               -----------------------------"
            put ""
            % The "ComputeAverage" program
            % Compute the average of a series of marks
            % Give average to the nearest integer
            put "Enter a series of marks"
            const sentinel := -1
            put "End with ", sentinel
            var mark : int
            var count, sum : int := 0
            loop
                get mark
                exit when mark = sentinel
                count := count + 1
                sum := sum + mark
            end loop
            put "The average mark is ", round (sum / count)
            delay (1000)
        label 3 :
            put "                               *    * *****  ******** *   *"
            put "                               **  ** *   *      *    *   *"
            put "                               * ** * *****      *    *****"
            put "                               *    * *   *      *    *   *"
            put "                               *    * *   *      *    *   *"
            put "                               -----------------------------"
            put ""
            var a : real
            var b : real
            var c : real
            var d : real
            var e : real
            var f : real
            loop
                put "This program will find the solutions (roots) of any trinomial quadratic function for you."
                put "Enter the a value (if the function is simple enter 1)"
                get a
                put "Enter the b value."
                get b
                put "Enter the c value."
                get c
                e := sqrt (b ** 2 - 4 * a * c)
                if e < 0 then
                    put "There are no real roots"
                else
                    d := ((-b) - sqrt (b ** 2 - 4 * a * c)) / (2 * a)
                    f := ((-b) + sqrt (b ** 2 - 4 * a * c)) / (2 * a)
                    put "The roots are ", d, " and ", f
                end if
            end loop
        label 4 :
            cls
            put "                               *    * *****  ******** *   *"
            put "                               **  ** *   *      *    *   *"
            put "                               * ** * *****      *    *****"
            put "                               *    * *   *      *    *   *"
            put "                               *    * *   *      *    *   *"
            put "                               -----------------------------"
            put ""
            % Calculate the amount of prime numbers in a range
            var x1, y1 : int
            var winID1 : int
            var font1 : int
            font1 := Font.New ("comicsans:60")
            var y2 : int
            put "Enter the number you want to go up to", "" ..
            get y2
            var test : int
            var primes : array 1 .. y2 of int
            var res : int
            primes (1) := 3
            primes (2) := 5
            primes (3) := 7
            var next : int := 3
            for i : 9 .. y2 by 2

                test := 0
                for j : 1 .. next
                    res := round (i / primes (j)) * primes (j)
                    if res not= i
                            then
                        test := test + 1
                    end if
                end for
                if test = next
                        then
                    next := next + 1
                    primes (next) := i
                    delay (10)
                    put primes (next)

                end if
            end for
            color (red)
            delay (200)
            Font.Draw ("Done", 1, 300, font1, blue)
            delay (900)
            put "Number of Prime numbers between 1 and " ..
            put y2 ..
            put ":"
            put next
            drawfillstar (100, 100, 200, 200, green)
            delay (2000)
        label 5 :
            cls
            put "                               *    * *****  ******** *   *"
            put "                               **  ** *   *      *    *   *"
            put "                               * ** * *****      *    *****"
            put "                               *    * *   *      *    *   *"
            put "                               *    * *   *      *    *   *"
            put "                               -----------------------------"
            color (red)
            const SPACE : int := 1
            var A : real
            var P : real
            var Q : real
            var RANGE := 50
            put " In order to use this program you will need to express the equation you want to sketch in standard form (Ax2+x2+C)"
            put " Enter the value of a"
            get A
            put "Enter the value of b"
            get P
            put "Enter the value of c"
            get Q
            cls
            for x : -RANGE .. RANGE by SPACE
                drawline (x + RANGE, round (A * ((x - P) ** 2) + Q), x + RANGE + SPACE, round (A * ((x - P + SPACE) ** 2) + Q), blue)
            end for
            for x5 : 0 .. maxx by 45
                for y5 : 0 .. maxy by 45
                    drawline (x5, y5, x5 + 45, y5, yellow)
                    drawline (x5, y5, x5, y5 + 45, yellow)
                end for
            end for
            delay (3000)
            cls
    end case

end menu2

proc menu3 ()
    var x, y, xx, yy : int := 50
    xx := 24
    yy := 24
    for a : 1 .. 2254
        drawbox (0, 0, maxx, maxy, black)
        drawfilloval (x, y, 10, 10, 12)
        x += xx
        y += yy
        if whatdotcolor (x + 11, y) = black or x + 10 >= maxx then
            xx := -3
        elsif whatdotcolor (x - 11, y) = black or x - 10 <= 0 then
            xx := 3
        end if
        if whatdotcolor (x, y + 11) = black or y + 10 >= maxy then
            yy := -3
        elsif whatdotcolor (x, y - 11) = black or y - 10 <= 0 then
            yy := 3
        end if
        delay (3)
    end for
    x := 0
    y := 0
    yy := maxy
    loop
        drawline (x, y, x, yy, 12)
        x += 1
        exit when x = maxx
        delay (3)
    end loop
    x := maxx
    y := 0
    yy := maxy
    loop
        drawline (x, y, x, yy, white)
        x -= 1
        exit when x = -1
        delay (3)
    end loop
    cls
    var option3 : int
    put "########  ##     ##  ######  #### ##    ## ########  ######   ######"
    put "##     ## ##     ## ##    ##  ##  ###   ## ##       ##    ## ##    ##"
    put "##     ## ##     ## ##        ##  ####  ## ##       ##       ##"
    put "########  ##     ##  ######   ##  ## ## ## ######    ######   ######"
    put "##     ## ##     ##       ##  ##  ##  #### ##             ##       ##"
    put "##     ## ##     ## ##    ##  ##  ##   ### ##       ##    ## ##    ##"
    put "########   #######   ######  #### ##    ## ########  ######   ######"
    put "---------------------------------------------------------------------"
    put ""
    put "If you would like to calculate the intrest on a bank balance than press 1"
    put "If you would like calculate the total amount for an item at a store than press 2"
    put "If you would like to convert Amercian currency to Candian currency press 3"
    get option3
    case option3 of
        label 1 :
            cls
            put "########  ##     ##  ######  #### ##    ## ########  ######   ######"
            put "##     ## ##     ## ##    ##  ##  ###   ## ##       ##    ## ##    ##"
            put "##     ## ##     ## ##        ##  ####  ## ##       ##       ##"
            put "########  ##     ##  ######   ##  ## ## ## ######    ######   ######"
            put "##     ## ##     ##       ##  ##  ##  #### ##             ##       ##"
            put "##     ## ##     ## ##    ##  ##  ##   ### ##       ##    ## ##    ##"
            put "########   #######   ######  #### ##    ## ########  ######   ######"
            put "---------------------------------------------------------------------"
            % This program computes the interest on a bank balance.
            var interestRate : real
            var bankBalance : real
            colorback (90)
            put "Please enter your bank balance!!"
            get bankBalance
            colorback (91)
            put "Please enter the current interest rate (do not put the percent sign)"
            get interestRate
            % Output new bank balance at end of year.
            var interest := interestRate * bankBalance / 100
            bankBalance := bankBalance + interest
            put "Your new balance at the end of the year is $ ", bankBalance : 10 : 2
            % The new balance is rounded off to the nearest cent on output
            % but the values stored in the variables interest or bankBalance
            % are not rounded off.
            delay (1800)
        label 2 :
            var gst, pst, cost, total, cash, grat : real
            cls
            put "########  ##     ##  ######  #### ##    ## ########  ######   ######"
            put "##     ## ##     ## ##    ##  ##  ###   ## ##       ##    ## ##    ##"
            put "##     ## ##     ## ##        ##  ####  ## ##       ##       ##"
            put "########  ##     ##  ######   ##  ## ## ## ######    ######   ######"
            put "##     ## ##     ##       ##  ##  ##  #### ##             ##       ##"
            put "##     ## ##     ## ##    ##  ##  ##   ### ##       ##    ## ##    ##"
            put "########   #######   ######  #### ##    ## ########  ######   ######"
            put "---------------------------------------------------------------------"
            colorback (91)
            put "| Welcome to Michaels's Cash Register Program!  |"
            put "=============================================="
            put "Please enter the amount of your item: " ..
            get cost
            put "=============================================="
            gst := cost * .08
            pst := cost * .07
            grat := cost * .17
            put "Gst: $", gst
            put "Pst: $", pst
            put "Grat: $", grat
            put "Tax Total: $", gst + pst
            total := cost + gst + pst + grat
            put "Grand Total is: $", total
            put "=============================================="
            put "Please enter your amount of cash: $" ..
            get cash
            cash := total - cash
            put "=============================================="
            total := cost + gst + pst + grat
            cash := total - cash
            if total >= cash then
                put "Not enough money get moving: $", cash - total
            elsif cash >= total then
                put "Your change is: $", cash - total
            end if
            delay (2000)
        label 3 :
            cls
            put "########  ##     ##  ######  #### ##    ## ########  ######   ######"
            put "##     ## ##     ## ##    ##  ##  ###   ## ##       ##    ## ##    ##"
            put "##     ## ##     ## ##        ##  ####  ## ##       ##       ##"
            put "########  ##     ##  ######   ##  ## ## ## ######    ######   ######"
            put "##     ## ##     ##       ##  ##  ##  #### ##             ##       ##"
            put "##     ## ##     ## ##    ##  ##  ##   ### ##       ##    ## ##    ##"
            put "########   #######   ######  #### ##    ## ########  ######   ######"
            put "---------------------------------------------------------------------"
            colorback (92)
            var CAD : real
            var AM : real
            var Total : real
            put " Please enter an amount of American Dollars"
            get AM
            colorback (82)
            put ""
            colorback (90)
            put ""
            colorback (91)
            put ""
            colorback (92)

            Total := AM * 1.278
            put "$", AM, " is ", "$", Total, " in Canadian Dollars"
            delay (2000)
    end case
end menu3

proc menu4 ()
    cls
    put "#    # #  ####   ####  ###### #      #        ##   #    # ######  ####  #    #  ####  "
    put "##  ## # #      #    # #      #      #       #  #  ##   # #      #    # #    # #      "
    put "# ## # #  ####  #      #####  #      #      #    # # #  # #####  #    # #    # #### "
    put "#    # #      # #      #      #      #      ###### #  # # #      #    # #    #     # "
    put "#    # # #    # #    # #      #      #      #    # #   ## #      #    # #    # #   # "
    put "#    # #  ####   ####  ###### ###### ###### #    # #    # ######  ####   ####  ####  "
    put ""
    put "If you would like to create a design with your mouse then press 1."
    put "If you would like to create a diamond with asterix signs then press 2."
    put "If you would like to watch a unique transformation than press 3."
    var option5 : int
    get option5
    case option5 of
        label 1 :
            cls
            % The "MouseTrails" program.
            var x, y, oldx, oldy, b : int := -1
            var c : int := 0
            put "Click the right mouse button and move the mouse around to create your design. This program will exit in two minutes."
            for count : 1 .. 9999999
                % Get the current location of the mouse
                mousewhere (x, y, b)
                % if the mouse has moved and the button is pressed.
                if (x not= oldx or y not= oldy) and b = 1 then
                    % Draw a circle around the mouse location
                    drawfilloval (x, y, 20, 20, c)
                    % Change the color
                    c := (c + 1) mod 16
                    oldx := x
                    oldy := y
                end if
            end for
        label 2 :
            cls
            var nlines : int
            var spaces : int
            var stars : int
            put " Please enter the number of lines that you want to use in your diamond!"
            get nlines
            cls
            put " "
            spaces := nlines
            for K : 1 .. nlines
                for decreasing H : spaces .. 1
                    put " " ..
                end for
                spaces := spaces - 1
                for I : 1 .. K + K - 1
                    put "*" ..
                end for
                put " "
            end for
            spaces := nlines
            stars := nlines * 2 - 1
            for K1 : 1 .. nlines
                for H1 : 1 .. spaces - (nlines - 1)
                    put " " ..
                end for
                spaces := spaces + 1
                for decreasing I1 : stars .. 1
                    put "*" ..
                end for
                stars := stars - 2
                put " "
                delay (800)
            end for
        label 3 :
            var youx, youy : int := 250
            for count : 1 .. 10000
                for a : 32 .. 62
                    drawoval (youx, youy, 75 - a + 32, 75 - a + 32, a div 2)
                end for
                drawoval (youx, youy, 75, 75, black)
                drawfill (1, 1, black, black)
                View.Update
                youy += Rand.Int (-15, 15)
                youx += Rand.Int (-15, 15)
                if youx <= 0 or youx >= maxx then
                    youx := maxx div 2
                end if
                if youy <= 0 or youy >= maxx then
                    youy := maxy div 2
                end if
            end for

    end case
end menu4
proc menu5 ()
    cls
    var option6 : int
    put " ######   ######  #### ######## ##    ##  ######  ########"
    put "##    ## ##    ##  ##  ##       ###   ## ##    ## ##"
    put "##       ##        ##  ##       ####  ## ##       ##"
    put " ######  ##        ##  ######   ## ## ## ##       ######"
    put "##    ## ##    ##  ##  ##       ##   ### ##    ## ##"
    put " ######   ######  #### ######## ##    ##  ######  ########"
    put ""
    put "If you would like to calculate the value of energy or mass using the equation E=mc^2 than press 1."
    put "If you would like to solve time dialation problems than press 2"
    get option6
    case option6 of
        label 1 :
            cls
            %E=MC2 Program. This program will calculate either energy or mass based on the users input.
            var variableType, unitType, missingUnit, units : string
            var answer, givenVariable : real
            colorback (7)

            %Title
            locate (1, 24)
            color (0)
            put "The E=MC2 Calculator" ..

            %Introduction
            locate (3, 1)
            color (0)
            put "Welcome to the E=MC2 Program. This program will calculate the missing variable in the equation E=MC2 based on your input foreither energy (e) or mass (m)"
            %User Input
            for x : 1 .. 99
                locate (8, 1)
                color (0)
                put "Please enter your input variable."
                put "Either 'e' for energy or 'm' for mass: " ..
                get variableType
                if variableType = "m" or variableType = "M" then
                    locate (10, 1)
                    color (0)
                    put "You have chosen mass, please continue"
                    unitType := "mass"
                    missingUnit := "energy"
                    units := "Joules"
                    locate (12, 1)
                    color (0)
                    put "Please enter the mass in Kg: " ..
                    get givenVariable
                    if givenVariable >= 0 then
                        locate (13, 1)
                        put "Thank you, please wait while your request is processed. "
                        exit
                    else
                        locate (7, 1)
                        color (12)
                        put "Your input for ", unitType, " was invalid, try again."
                        locate (12, 1)
                        put "                                             "
                        locate (9, 40)
                        put "                            "
                    end if
                elsif variableType = "e" or variableType = "E" then
                    locate (10, 1)
                    color (0)
                    put "You have chosen energy, please continue"
                    unitType := "energy"
                    missingUnit := "mass"
                    units := "Kg"
                    locate (12, 1)
                    color (0)
                    put "Please enter the energy in Joules: " ..
                    get givenVariable
                    if givenVariable >= 0 then
                        locate (13, 1)
                        put "Thank you, please wait while your request is processed. "
                        exit
                    else
                        locate (7, 1)
                        color (12)
                        put "Your input for ", unitType, " was invalid, try again."
                        locate (12, 1)
                        put "                                             "
                        locate (9, 40)
                        put "                            "
                    end if
                else
                    locate (7, 1)
                    color (12)
                    put "You have chosen incorrectly, please try again"
                    locate (9, 39)
                    delay (3000)
                end if
            end for

            %Processing
            if variableType = "m" or variableType = "M" then
                answer := givenVariable / (3 * (10 ** 8))
            else
                answer := givenVariable * (3 * (10 ** 8))
            end if

            %Output
            locate (17, 1)
            color (0)
            put "Based on your input, the value of your missing variable, wich is ", missingUnit, ", is equal to: " ..
            color (14)
            put answer, " ", units

            %Ending Notes
            locate (20, 1)
            put "Thank you for using The E=MC2 Calculator"
            delay (1800)

        label 2 :
            cls
            put " ######   ######  #### ######## ##    ##  ######  ########"
            put "##    ## ##    ##  ##  ##       ###   ## ##    ## ##"
            put "##       ##        ##  ##       ####  ## ##       ##"
            put " ######  ##        ##  ######   ## ## ## ##       ######"
            put "##    ## ##    ##  ##  ##       ##   ### ##    ## ##"
            put " ######   ######  #### ######## ##    ##  ######  ########"
            put ""
            var t1, v, c, t, a, b, d, l, l1, l2, m, M : real
            c := 186000
            put "Physics!!"
            put "Time Dilation"
            put "You are on a rocket going near the speed of light."
            put "How much time a=has passed for an observer"
            put "Please enter your speed in decimal form(of LightSpeed)i.e V / 186,000)"
            get v
            put "Please enter number of years/days spent on rocket."
            get t1
            a := v ** 2
            b := 1 - a
            d := b ** 0.5
            t := t1 / d
            put " The time elapsed on earth is"
            put t
            put "Here for length dilation(means to an observer you look shorter)"
            put "*Remember your still going the same speed as inputed before"
            put "What the length of your ship"
            get l
            l1 := (1 - v) ** 0.5
            l2 := l1 * l
            put "Your length form an observer is"
            put l2
            put "Mass distortion"
            put "What is ur mass(kg)"
            get m
            M := (m * (1 - v ** 2) ** -0.5)
            put "Your mass at the speed of ", v, " will be ", M, "!!"
            delay (1000)
    end case
end menu5
proc happyface
    var x1, y1, x2, y2, a : int
    var r, n : real
    n := 5
    a := 250
    for count : 0 .. 20
        for k : 0 .. 10
            cls
            Draw.FillBox (0, 0, maxx, maxy, 7)
            Draw.Text ("DO YOUR HOMEWORK !!!!!!!", maxx - 900, maxy - 30, Font.New ("serif:22:bold"), 40)
            for t : 0 .. 360
                r := sind ((t + k) * n) * a
                x1 := round (cosd (t) * r) + maxx div 2
                y1 := round (sind (t) * r) + maxy div 2
                r := sind ((t + 1 + k) * n) * a
                x2 := round (cosd ((t + 1)) * r) + maxx div 2
                y2 := round (sind ((t + 1)) * r) + maxy div 2
                Draw.Line (x1, y1, x2, y2, 5)
            end for
            for i : 1 .. round (n)
                x1 := round (cosd (i * 72 - k + 18) * a / 4 * 3) + maxx div 2
                y1 := round (sind (i * 72 - k + 18) * a / 4 * 3) + maxy div 2
                Draw.Fill (x1, y1, 5, 5)
            end for
            Draw.FillOval (maxx div 2, maxy div 2, 50, 50, 43)
            for i : 235 .. 315
                x1 := round (cosd (i - k) * 35) + maxx div 2
                y1 := round (sind (i - k) * 35) + maxy div 2
                Draw.FillOval (x1, y1, 5, 5, 7)
            end for
            x1 := round (cosd (50 - k) * 30) + maxx div 2
            y1 := round (sind (50 - k) * 30) + maxy div 2
            Draw.FillOval (x1, y1, 7, 7, 7)
            x1 := round (cosd (130 - k) * 30) + maxx div 2
            y1 := round (sind (130 - k) * 30) + maxy div 2
            Draw.FillOval (x1, y1, 7, 7, 7)
            View.Update
            delay (5)
        end for
        exit when hasch
    end for
end happyface
proc history ()
    var a, b, one, two, three, four, five, six, seven, eight, nine, ten, endprogram : string
    var score : real := 0
    var z : int := 1
    colorback (black) %This sets the backround black
    score := 0 %This sets the score to 0
    cls
    color (white)
    put " Would you like to continue in my program(y/n)?"
    get a
    if a = "y" then
        put "Alright you will be asked some questions on a subject of your choice."
        put "Would you like to be asked on (h)istory."
    else
    end if
    get b
    if b = "h" then
        put "Okay here are some questions related to the grade 10 history curriculem"
        put "You will have to answer either a, b, c, or d."
        color (brightpurple) %This sets the text colour to purple
        put "These following questions are on WWI."
        color (white)
        put "1. Who was the most famous German flying ace?"
        put ""
        delay (600) %This delays the text so it comes in a little later
        put "a) Billy Bishop"
        delay (600)
        put "b) Snoopy"
        delay (600)
        put "c) Baron Von Richthofen"
        delay (600)
        put "d) A red crayon with flying goggles."
    else %any other answer will come down here
        put "Too bad my program is on history so here are some questions "
        put "related to the grade 10 history curriculem."
        put "You will have to answer either a, b, c, or d."
        color (brightpurple)
        put "These following questions are on WWI."
        color (white)
        put "1. Who was is the most famous German flying ace?"
        put ""
        delay (600) %This delays the text so it comes in a little later
        put "a) Erich Hartmann"
        delay (600)
        put "b) Snoopy"
        delay (600)
        put "c) Baron Von Richthofen"
        delay (600)
        put "d) A red crayon with flying goggles"
    end if
    get one
    cls
    locate (maxrow div 2, maxcol div 2 - 8)
    %This centers it
    if one = "c" then
        delay (1000)
        color (green)
        Music.PlayFile ("rightanswer.wav") %will play some clapping music
        put "You are correct."
        score := score + 1 %This adds one point to the score
        delay (2000)
        cls %this will clear the screen
    else
        Music.PlayFile ("youstink.wav") %will play this music
        delay (1000)
        color (brightred)
        put "That is incorrect."
        delay (2000)
        cls
    end if
    color (white)
    put "2. Who shot down the Red Baron?"
    put ""
    delay (600)
    put "a) Roy Brown"
    delay (600)
    put "b) Charlie brown with a machine gun"
    delay (600)
    put "c) Snoopy again"
    delay (600)
    put "d) Billy Bishop"
    get two
    cls
    locate (maxrow div 2, maxcol div 2 - 8)
    %This centers it
    if two = "a" then
        delay (2000)
        color (green)
        Music.PlayFile ("rightanswer.wav") %will play some clapping music
        put "That is correct."
        score := score + 1
        delay (2000)
        cls
    else
        delay (2000)
        color (brightred)
        Music.PlayFile ("youstink.wav")
        put "That is incorrect."
        delay (2000)
        cls
    end if
    color (white)
    put "3. What were given to the soldiers at Vimy Ridge in preparation to the battle?"
    put ""
    delay (600)
    put "a) Cigarettes"
    delay (600)
    put "b) Maps"
    delay (600)
    put "c) A full scale model of the battle field"
    delay (600)
    put "d) Fabric and stuffing to make german voodoo dolls"
    get three
    cls
    locate (maxrow div 2, maxcol div 2 - 8)
    %This centers it
    if three = "b" then
        delay (2000)
        color (green)
        Music.PlayFile ("rightanswer.wav") %will play some clapping music
        put "That is correct."
        score := score + 1
        delay (2000)
        cls
    else
        delay (2000)
        color (brightred)
        Music.PlayFile ("youstink.wav")
        put "That is incorrect."
        delay (2000)
        cls
    end if
    color (white)
    put "4. What was the major strike during this decade?"
    put ""
    delay (600)
    put "a) Midgets anonymus strike"
    delay (600)
    put "b) Workers Componsation Strike"
    delay (600)
    put "c) Snoopy likes planes strike"
    delay (600)
    put "d) Winnipeg General Strike"
    get four
    cls
    if score > 5 then
        delay (600)
        color (green)
        put "Your score is ", score, "0%"
        delay (600)
        put "You have passed grade 10 acedemic History."
    elsif score < 5 then
        delay (600)
        color (brightred)
        put "Your score is ", score, "0%"
        delay (600)
        put ""
        put "You just failed grade 10 acedemic History and are quite stupid."
    elsif score = 0 then
        Music.PlayFile ("evil_laugh.wav")
        delay (600)
        put "Your score is ", score, "%"
        delay (600)
        put ""
        put "Thank you for playing but your bad at history."
        end if
        delay (3000)
    end history
    proc mainMenu ()
        cls
        colorback (82)
        put ""
        colorback (90)
        put ""
        colorback (91)
        put ""
        colorback (92)
        put "######## ##    ##       ##  #######  ##    ##    #### "
        put "##       ###   ##       ## ##     ##  ##  ##     #### "
        put "##       ####  ##       ## ##     ##   ####      #### "
        put "######   ## ## ##       ## ##     ##    ##        ##  "
        put "##       ##  #### ##    ## ##     ##    ##            "
        put "##       ##   ### ##    ## ##     ##    ##       #### "
        put "######## ##    ##  ######   #######     ##       #### "
        put ""
        delay (1000)
        colorback (93)
        put ""
        colorback (94)
        put ""
        colorback (95)
        put ""
        put ""
        colorback (96)
        put ""
        put ""
        put ""
        put ""
        put ""
        put "For English press 1 (Calculate the amount of letters in inputed text, count the amount of words in a text)"
        colorback (52)
        put
            "For math press 2 (Calculate circle areas,calculate the average of a series of numbers, calculate the roots of a quadratic formula , calculate the amount a prime numbers in a range , graph a parabola or quadratic equation)"
        colorback (82)
        put "For business press 3 (Calculate the interest on a bank balance, calculate the amount of a payment at the cash register, convert Amercian currency to Candian currency )"
        colorback (100)
        put "For miscellaneous press 4 (Create a unique design with your mouse, create a diamond with asterix signs!!!,watch a variety of unique transformations)!!!!!"
        colorback (82)
        put "For science press 5 (Calculate the value of energy or mass using the equation E=mc^2, solve time dialation problems)"
        colorback (90)
        put "If you are bored than press 6!!!!!!!!!"
        colorback (91)
        put "If you would like to test your history skills than press 7."
        colorback (92)
        put ""
        put ""
        colorback (93)
        put ""
        colorback (94)
        put ""
        colorback (95)
        put ""
        put ""
        colorback (96)
        put ""
        put ""
        put ""
        put ""
        put ""
        get choice
        if choice = 1 then
            menu1
        elsif choice = 2 then
            menu2
        elsif choice = 3 then
            menu3
        elsif choice = 4 then
            menu4
        elsif choice = 5 then
            menu5
        elsif choice = 6 then
            happyface
        elsif choice = 7 then
            history
        end if
    end mainMenu

    loop
        mainMenu
    end loop


Mod edit: please use syntax or code tags when you post code:
code:

[syntax="turing"]
put "my code"
[/syntax]
Mike123




PostPosted: Sat Jan 24, 2009 6:04 pm   Post subject: RE:Grade 10 ISU!!!!!!

Please comment!!!!
Clayton




PostPosted: Sat Jan 24, 2009 7:00 pm   Post subject: RE:Grade 10 ISU!!!!!!

... What?
Homer_simpson




PostPosted: Sat Jan 24, 2009 7:27 pm   Post subject: Re: Grade 10 ISU!!!!!!

it's good for your first program
Dan




PostPosted: Mon Jan 26, 2009 3:11 am   Post subject: Re: RE:Grade 10 ISU!!!!!!

Mike123 @ 24th January 2009, 6:04 pm wrote:
Please comment!!!!


You stole code and did not give credit to the original author and this is not the first time you have done this on this site.

You fail at life and at programming, you are now banned.

Have a nice day.
Computer Science Canada Help with programming in C, C++, Java, PHP, Ruby, Turing, VB and more!
Sponsor
Sponsor
Sponsor
sponsor
andrew.




PostPosted: Mon Jan 26, 2009 4:13 pm   Post subject: RE:Grade 10 ISU!!!!!!

Wow, how did you remember those happy faces from 2003?
saltpro15




PostPosted: Mon Jan 26, 2009 4:32 pm   Post subject: RE:Grade 10 ISU!!!!!!

lol go dan! I had a feeling someone who posts "Please Comment!!!!!!" did not make that program
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 10 Posts ]
Jump to:   


Style:  
Search: