Home‎ > ‎

Calculations

Useful Calculations Programs 

We use computers because they do complicated calculations and solve problems very quickly. Here we will get some practice using the computer to solve problems for us. So far, we have written programs with pop-up Dialog boxes. You may have discovered that it gets tedious filling them in and always clicking to them.

We are going to learn an easier way by typing on the screen directly. We will be filling in "Text" fields on the screen. We will also be using "Label" fields to add labels to the screen. Then when the user presses the "Done" button, we will get that info from the screen and save it in our own variables using the "Put" command. We can then do our own calculations and then "Put" the answers back on the screen.

Projects:
These are small projects that you can do that involve pulling data from the screen, doing some calculations, then putting the answer back on the screen. Try a couple for practice, or any other that you can think of. You may end up with some very useful programs that you can use on your computer or later on, put them on your cellphone.

1. Calculate the area and perimeter of a rectangle (or  triangle, circle, or more than one of them)
    You type in the length and width and the program will calculate the area and perimeter of the rectangle

              
   
              


2. Change calculator.
    You type in the cost of the item and the amount that you will pay and the program will calculate the change that you will get back.

                        


3. Sales Tax Calculator
    You type in the price of the item and the program gives you the amount of tax due and the total.

                  


4. Tip Calculator
    You type in the bill and the computer gives you the amount of the tip at 5%, 10%, 15% and 20%

              


5. Euro Converter
    You type the amount in USD (U.S. Dollars) and the program converts it to Euros

                              
                        
 
note: If you do money programs, you might need to use the "round" command. (Click on the "Dictionary" icon and look it up to see how to do it)


6. Age Calculator
    You type your age in years and it tells you how old you are in months

                      


7. Height Calculator
    You type in your height in feet and inches and the program tells you your height in inches
    You type in your height in feet and inches and the program tells you your height in meters
    You type in your height in feet and inches and the program tells you your height in centimeters


8. Time Calculator
    You type in the number of days and the program tells the number of hours, minutes, and seconds that it is.

                      


9. Weight/Units Calculator
    You type in your weight in pounds and calculate it in Kilograms.

                  


10. Other Programs involving calculations

               


                      


11. Other Programs involving calculations - Your ideas?

    Split the Lunch - Ask the total amount and # of people, then calculate the amount each person owes
    The Combination lock - Ask for 3 numbers, then tell them if it opens or not. (the user must enter all 3 numbers and in the correct order for the lock to open. (you don't tell them which is wrong, just that it does not open (just like your school locker)

   

Comments