TGC Codebase Backup



ultimate calc the best by Anonymous Coder

5th Jun 2005 10:46
Summary

basic code, only had the software for two days! easy to use, multipfunctional calculater uses "GOTO" and "THEN" and "IF" lots of times



Description

easy to understand code, but effective . th first number determines the operation that the calcuoater does. then the first and second numbers determine the numbers that the calculater aplies the function



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    SET CURSOR 200,0
PRINT "CREATED BY FLYNNY"
BEGINING:
PRINT "Choose a sum to perform"
PRINT "1=Multiplication"
PRINT "2=Addition"
PRINT "3=Subtraction"
PRINT "4=Division"
PRINT "5=Circumference"
PRINT "6=Area"

INPUT "ENTER A NUMBER   ",a

IF a=1 THEN GOTO MULTIPLICATION
IF a=2 THEN GOTO ADDITION
IF a=3 THEN GOTO SUBTRACTION
IF a=4 THEN GOTO DIVISION
IF a=5 THEN GOTO CIRCUMFERENCE 
IF a=6 THEN GOTO AREA

MULTIPLICATION:
INPUT "Enter first number   ",A#
INPUT "Enter second number   ",B#
SUMA#=A#*B#
PRINT "And the answer is..."
PRINT SUMA#
GOTO BEGINING

ADDITION:
INPUT "Enter first number   ",C#
INPUT "Enter second number   ",D#
SUMB#=C#+D#
PRINT "And the answer is..."
PRINT SUMB#
GOTO BEGINING

SUBTRACTION:
INPUT "Enter first number   ",E#
INPUT "Enter second number   ",F#
SUMC#=E#-F#
PRINT "And the answer is..."
PRINT SUMC#
GOTO BEGINING

DIVISION:
INPUT "Enter first number   ",G#
INPUT "Enter second number   ",H#
SUMD#=G#/H#
PRINT "And the answer is..."
PRINT SUMD#
GOTO BEGINING

CIRCUMFERENCE:
INPUT "Enter number   ",I#
J#=3.14
SUME#=I#*J#
PRINT "And the answer is..."
PRINT SUME#
GOTO BEGINING

AREA:
INPUT "Enter first number   ",K#
INPUT "Enter second number   ",L#
SUMF#=K#*L#
PRINT "And the answer is..."
PRINT SUMF#
GOTO BEGINING