16 Nov 2000 AArthur   » (Journeyer)

Okay, this qbasic shit in Advanced Computer class is really getting on my nevers. Especially how you declare strings with a $ at the end of stuff. I much prefer the way bash works. Luckly this is my final qbasic project. I plan to make it my last one (assuming I don't have to do this crap in college).

Here is another lame qbasic program I did for my beginning programming class:

'Formula Program

CLS

choose: PRINT PRINT " finUN - (c) 2000, Andrew Arthur, BSDL" PRINT PRINT "This program finds the area of a variety of shapes." PRINT PRINT "Type of Shape Your Finding Area of:" PRINT " 1) Circle" PRINT " 2) Square" PRINT " 3) Rectangle" PRINT " 4) Triangle" PRINT " 5) Octogon" PRINT " 6) Oval" PRINT " 7) Exit finUN" PRINT PRINT "Note: Hitting Return will Quit This Program." PRINT

INPUT "Type of Shape: ", shape$ PRINT

IF shape$ = "1" THEN GOTO cir IF shape$ = "2" THEN GOTO squ IF shape$ = "3" THEN GOTO rec IF shape$ = "4" THEN GOTO tri IF shape$ = "5" THEN GOTO oct IF shape$ = "6" THEN GOTO ova IF shape$ = "" OR shape$ = "7" THEN GOTO intheend CLS PRINT " INVALID Value! " PRINT "" PRINT "Please Try Again." PRINT "" GOTO choose

cir: INPUT "Diameter of the circle: ", diacir INPUT "Units: ", unitcir$ diacir1 = diacir ^ 2 diacir2 = diacir1 * 3.14 PRINT "The Size of the Circle is: "; diacir2; unitcir$; " Squared" SLEEP 100000 devnull$ = INKEY$ CLS GOTO choose

squ: INPUT "Length of Square: ", sqrl INPUT "Width of Square: ", sqrw INPUT "Units of Measurement: ", unitsqr$ arsq = sqrl * sqrw PRINT "Area of the Square is: "; arsq; unitsqr$; " Squared"

SLEEP 100000 devnull$ = INKEY$ CLS GOTO choose

rec: INPUT "Length of Rectangle: ", recl INPUT "Width of Rectangle: ", recw INPUT "Units of Measurement: ", unitrec$ arec = recl * recw PRINT "Area of the Square is: "; arec; unitrec$; " Squared" SLEEP 100000 devnull$ = INKEY$ CLS GOTO choose

tri: INPUT "Length of Rectangle: ", recl INPUT "Width of Rectangle: ", recw INPUT "Units of Measurement: ", unitstri$ arei = (recl * recw) / 2 PRINT "Area of the Square is: "; arei; unitstri; " Squared" SLEEP 100000 devnull$ = INKEY$ CLS GOTO choose

oct: PRINT "This finds the parameter of an Octagon with sides all of " PRINT "the same lenght." PRINT INPUT "What is the length of ones side of the Octagon: "; oct1 INPUT "Units of Measument: "; octmeas$

oct2 = oct1 * 8 PRINT "The size of the Octagon's Parameter is: "; oct2; octmeas$; " Squared" SLEEP 100000 devnull$ = INKEY$ CLS GOTO choose

ova: INPUT "What is the diameter of the Oval: ", diaova INPUT "Units:", unitcir$ diaova1 = diaova ^ 2 diaova2 = diaova1 * 3.14 PRINT "The Size of the Oval is: "; diaova2; unitcir$; " Squared" SLEEP 100000 devnull$ = INKEY$ CLS GOTO choose

intheend: CLS END

Latest blog entries     Older blog entries

New Advogato Features

New HTML Parser: The long-awaited libxml2 based HTML parser code is live. It needs further work but already handles most markup better than the original parser.

Keep up with the latest Advogato features by reading the Advogato status blog.

If you're a C programmer with some spare time, take a look at the mod_virgule project page and help us with one of the tasks on the ToDo list!