Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Dec 12th, 2006, 10:05 AM   #1
m0rb1d
Newbie
 
Join Date: Nov 2006
Posts: 19
Rep Power: 0 m0rb1d is on a distinguished road
error 3 Expected end-of-statement

So, I've moved on from QBasic, but, I still mess around with what little I know from time to time. I was attempting to make a simple program for a friend, but alas, I keep getting this error when trying to compile it. I can run the program with no errors inside of QBasic, but, cant compile while the compiler finds whatever is wrong. I've gone through the code line by line, and just cant seem to find anything wrong.

Also, I KNOW there are more efficient ways to have done this, but, I dont know them. Ya work with what ya got, so, I apologize for the lengthy code, but, here it is.

CLS
COLOR 4
PRINT "Ken Is An Asshat Version Zero Point One"
PRINT "Written by RathMon for BLaZeN"
COLOR 15
PRINT
PRINT
PRINT "1. Start"
PRINT "2. Exit "
INPUT "Enter 1 or 2: ", choice%
IF choice% = 2 THEN
     GOTO 500
     ELSEIF choice% = 1 THEN
     GOTO 100
     END IF
100
COLOR 3
INPUT "What is the cartridge name?", cartName$
COLOR 15
PRINT
PRINT "So, we have a "; cartName$
PRINT
PRINT "We will now start calculating cost."
110
CLS
PRINT "1.  Wiper Blade "
PRINT "2.  PCR Roller  "
PRINT "3.  Drum        "
PRINT "4.  Recovery 1  "
PRINT "5.  Doctor Bld. "
PRINT "6.  Mag Sleeve  "
PRINT "7.  Toner       "
PRINT "8.  Recovery 2  "
PRINT "9.  Box         "
PRINT "10. Insert      "
PRINT "11. Bag         "
PRINT "12. Client Wages "
PRINT "13. Generate Cost "
PRINT "14. Exit Program "
COLOR 4
INPUT "Choose a part number to edit cost.", editCost%
COLOR 15
IF editCost% = 1 THEN
        PRINT "You have chosen Wiper Blade. The current"
        PRINT "cost of this item is"; wiper
        PRINT
        INPUT "Enter the cost of this item.", wiper
        GOTO 110
        ELSEIF editCost% = 2 THEN
        PRINT "You have chosen PCR Roller. THe current"
        PRINT "cost of this item is "; pcrRoller
        INPUT "Enter the cost of this item. ", pcrRoller
        GOTO 110
        ELSEIF editCost% = 3 THEN
        PRINT "You have chosen Drum. The current cost of"
        PRINT "this item is "; Drum
        INPUT "Enter the cost of this item. ", Drum
        GOTO 110
        ELSEIF editCost% = 4 THEN
        PRINT "You have chosen Recovery 1. The current"
        PRINT "cost of this item is "; recov1
        INPUT "Enter the cost of this item. ", recov1
        GOTO 110
        ELSEIF editCost% = 5 THEN
        PRINT "You have chosen Doctor Blade. The current"
        PRINT "cost of this item is "; doctor
        INPUT "Enter the cost of this item. ", doctor
        GOTO 110
        ELSEIF editCost% = 6 THEN
        PRINT "You have chosen Mag Sleeve. The current cost"
        PRINT "of this item is "; magSleeve
        INPUT "Enter the cost of this item: ", magSleeve
        GOTO 110
        ELSEIF editCost% = 7 THEN
        PRINT "You have chosen Toner. The curren cost of"
        PRINT "this item is "; toner
        INPUT "Enter the cost of this item: ", toner
        GOTO 110
        ELSEIF editCost% = 8 THEN
        PRINT "You have chosen Recovery 2. The current cost"
        PRINT "of this item is: "; recov2
        INPUT "Enter the cost of this item: ", recov2
        GOTO 110
        ELSEIF editCost% = 9 THEN
        PRINT "You have chosen Box. The current cost of this"
        PRINT "item is "; box
        INPUT "Enter the cost of this item: ", box
        GOTO 110
        ELSEIF editCost% = 10 THEN
        PRINT "You have chosen Insert. The current cost of"
        PRINT "this item is "; inserts
        INPUT "Enter the cost of this item: ", inserts
        GOTO 110
        ELSEIF editCost% = 11 THEN
        PRINT "You have chosen Bag. The current cost of"
        PRINT "this item is "; bag
        INPUT "Enter the cost of this item: ", bag
        GOTO 110
        ELSEIF editCost% = 12 THEN
        PRINT "You have chosen Client Wages. The current"
        PRINT "cost of this item is "; clientWages
        INPUT "Enter the cost of this item: ", clientWages
        GOTO 110
        ELSEIF editCost% = 13 THEN
        totalCost = wiper + pcrRoller + Drum + recov1 + magSleeve + doctor + toner + recov2 + bag + box + clientWages + inserts
        PRINT "The total cost to remanufactur a "; cartName$; " is "; totalCost
        INPUT "What do you charge for this cartridge?", price
        profit = price - totalCost
        GOTO 125
        ELSEIF editCost% = 14 THEN GOTO 500
        END IF
125
CLS
COLOR 3
PRINT "The total cost is "; totalCost
PRINT "The price is "; price
PRINT "Which gives a profit of "; profit
IF profit > 0 THEN
   PRINT "Good job, your making money!"
   ELSEIF profit <= 0 THEN
   PRINT "Not too good. Your losing money!"
   END IF
SLEEP 3
GOTO 500
500
CLS
COLOR 15
PRINT "This is the end of the program, good bye!"
SLEEP 2
END
m0rb1d is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
switch statement NightShade01 Java 5 Jan 11th, 2007 2:40 AM
SQL Select Statement Performance King Other Scripting Languages 6 Dec 1st, 2006 5:12 PM
error: expected primary-expression... rup C++ 18 Apr 17th, 2006 2:24 PM
Trouble with a swith statement cjaime C 10 Nov 8th, 2005 11:09 AM
Total noob, trouble expected? Mudanie Python 18 Oct 27th, 2005 10:03 AM




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 6:27 AM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC