ok I hope this doesn’t get locked but this is the only place I can go to get help. ive tried googling it but i cant find anything. So to keep me from failing my college class, please help.
Ok my teacher wants me to replace my PRINT command with something else so that more data will be displayed. Does anyone know what commands can replace PRINT in order to display something else? Here is my program.
REM description: this program calculates
REM the billing amount for a
REM company running a copying
REM service
REM---------------------------------------
REM *The first 500 copies are billed at
REM 5 cents per copy
REM
REM *The next 500 copies are billed at
REM 4 cents per copy
REM
REM *Any additional copies are billed at
REM 3 cents per copy
REM---------------------------------------
REM Customer Copies
REM -----------------------------
REM XYZ Amalgamated 1,200
REM ABC Industries 200
REM TR Systems Limited 800
REM
REM***************************************
CLS
PRINT "Customer: Billing Amount:"
PRINT " "
READ cust$, Copies
DO WHILE cust$ <> "end"
IF Copies > 1000 THEN
LET a = ((Copies - 1000) * .03) + 45
PRINT cust$; " $"; a
ELSEIF Copies > 500 THEN
LET b = ((Copies - 500) * .04) + 25
PRINT cust$; " $"; b
ELSE
LET c = Copies * .05
PRINT cust$; " $"; c
END IF
READ cust$, Copies
LOOP
REM**************data statnments**********
DATA "xyz Amalgamated", 1200
DATA "ABC Industries", 200
DATA "TR Systems Limited", 800
DATA "end",
END
-
Did it work? I looked in the QBASIC book in my Design & Logic class today and I found something about a PRINT USING statement. It seems be QB's version of formatnumber/currency. So, let's say that x is the variable that equals 5. To output it as 5.00, you would put: PRINT USING #.##; x If you wanted to output it as $5.00, you would put: PRINT USING $.$$; x *Note: There may have been quotes around the #'s and $'s. I don't remember.