
-----------------------------------
turinghelp101
Tue Jan 17, 2012 5:43 pm

How to make a program more efficent by using arrays
-----------------------------------
What is it you are trying to achieve?

I am making a thermometer that changes temperature from fahrenheit to celcius and displays it.

What is the problem you are having?

I am not done yet, but as you can see I am individually programming each number, and one of my friends told me that the program could be made more efficent by using arrays or somthing. 

1.So first of all im not sure if it can be made more efficently
2. If it can, what do you use to make it more efficent, and how can I apply it to the program
(by efficent I mean use less lines, and not having to program each individual number

Describe what you have tried to solve this problem

I really have no idea where to start  :?   

Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)






This is my program:

procedure drawrectangle
    %screen formatting
    setscreen ("graphics:800;400")
    %orange button
    var number : int
    var rangeX, rangeY, button : int
    cls
    drawfillbox (200, 50, 250, 100, 42)
    %keyboard input
    put "Enter your temperature in farenheit from -4 to 68"
    get number
    put "Your temperature in celcius is:", (5 / 9) * (number - 32);
    put "Click on the orange box to repeat"


    %Mouse input
    loop
        mousewhere (rangeX, rangeY, button)
        if (rangeX >= 200 and rangeX = 50 and rangeY 