Opinions/help on my cs project so far...

RSI

Diamond Member
May 22, 2000
7,281
1
0
OK what I have to do is make some "store" thing.. I have to use certain commands/statements the teacher wants us to learn. Well anyway, unfortunately we use GWBASIC...

You need GWBASIC to run it, unless you compile it to an EXE, which I have no idea of how to do.

-GWBASIC
-MLAH.BAS <- My program so far

To run, enter gwbasic and type load&quot;mlah&quot;. It should say &quot;OK&quot;, then type RUN and press enter... There you go. :)

I need to have ~4-5 items... I dunno what to put. Anybody have any ideas or suggestions, help, anything... Thanks. :D

-RSI
 

Killbat

Diamond Member
Jan 9, 2000
6,641
1
0
The &quot;store&quot; program for my QBASIC class. Should be easily adapted to GWBASIC, just throw in some line numbers and such. :)
The main feature is the dynamic item list.

init:
datastart:
DATA &quot;Beef Jerky&quot;,2.95
DATA &quot;Dr. Pepper&quot;,.65
DATA &quot;Windex&quot;,4.5
DATA &quot;Spam&quot;,3.95
DATA &quot;Energy drink&quot;,.99
DATA &quot;Sack-O-Meats&quot;,.99
DATA &quot;Mystery Box&quot;,2.45
DATA &quot;Nintendo GameCube&quot;,149.99
DATA &quot;END&quot;,0
maxitems% = 0
countitems:
READ a$, a#
IF a$ <> &quot;END&quot; THEN
maxitems% = maxitems% + 1
GOTO countitems
END IF
DIM itemname$(maxitems%), itemcost#(maxitems%), itemcount%(maxitems%)
RESTORE datastart
FOR i% = 0 TO maxitems% - 1
READ a$, a#
itemname$(i%) = a$
itemcost#(i%) = a#
itemcount%(i%) = 0
NEXT i%

main:
CLS
LOCATE 1, 1: COLOR 14: PRINT &quot;_Items in stock_ _Cost_ _In cart_&quot;: COLOR 7
subtotal# = 0
FOR i% = 0 TO maxitems% - 1
LOCATE 2 + i%, 1: PRINT USING &quot;##&quot;; i%; : PRINT &quot;) &quot;; itemname$(i%)
LOCATE 2 + i%, 25: PRINT USING &quot;$$##.##&quot;; itemcost#(i%)
LOCATE 2 + i%, 39: PRINT itemcount%(i%)
subtotal# = subtotal# + (itemcost#(i%) * itemcount%(i%))
NEXT i%
LOCATE maxitems% + 3, 25: COLOR 14: PRINT &quot;subtotal:&quot;: COLOR 7
LOCATE maxitems% + 3, 35: PRINT USING &quot;$$###.##&quot;; subtotal#
LOCATE maxitems% + 4, 24: COLOR 14: PRINT &quot;6.25% tax:&quot;: COLOR 7
LOCATE maxitems% + 4, 35: PRINT USING &quot;$$###.##&quot;; subtotal# * .0625
LOCATE maxitems% + 5, 28: COLOR 14: PRINT &quot;total:&quot;: COLOR 7
LOCATE maxitems% + 5, 35: PRINT USING &quot;$$###.##&quot;; subtotal# * 1.0625
LOCATE maxitems% + 7, 1
PRINT &quot;To add items, type the item number and then quantity, separated by commas (type 99,99 to check out)&quot;
INPUT additem%, addcount%
IF additem% = 99 AND addcount% = 99 THEN GOTO checkout
IF additem% < 0 OR additem% > maxitems% - 1 THEN GOTO main
IF itemcount%(additem%) + addcount% < 0 THEN GOTO main
itemcount%(additem%) = itemcount%(additem%) + addcount%
GOTO main
checkout:
PRINT USING &quot;Customer owes $$###.##&quot;; subtotal# * 1.0625
INPUT &quot;How much has the customer paid&quot;; tender#
PRINT USING &quot;The customer is owed $$###.##&quot;; tender# - (subtotal# * 1.0625)
 

RSI

Diamond Member
May 22, 2000
7,281
1
0
Woah. :Q

Did you check out mine so far? ... Some of the code looks pretty different, but it does look like I could use some of that. But I'm not sure I want to try that seeing as how I already have a lot of mine done...

-RSI
 

RSI

Diamond Member
May 22, 2000
7,281
1
0
No, this is 'high' school. :|

GWBASIC... My god. What an utterly worthless language to learn these days! :p

-RSI
 

Killbat

Diamond Member
Jan 9, 2000
6,641
1
0
Well, it helps people who have never even heard the term &quot;programming&quot; get some basic concepts solidified. Why don't you take Fortran, or B? :)
 

RSI

Diamond Member
May 22, 2000
7,281
1
0
No. I'm not big into programming, but I took this course hoping I'd learn something wortwhile. Learning BASIC pretty much is worthless to me, since I want to learn something more along the lines of C++, which I scratched just a bit of.

-RSI
 

BCYL

Diamond Member
Jun 7, 2000
7,803
0
71
Well learning any kind of computer language when you have no previous programming experience is always helpful... it lets you have a grasp of what programming is all about... Many things you learn in BASIC should be transferrable over to C++ or any other language, only need to learn the difference in syntax...

(But you do have to learn Object-oriented programming in C++, cuz I don't think BASIC is a O-O language)
 

RSI

Diamond Member
May 22, 2000
7,281
1
0
Basic is a C-A language. A Crap-Ass language.

I prefer programming in C++ by far, even with the little experience I have in both.

-RSI
 

RSI

Diamond Member
May 22, 2000
7,281
1
0
No. I'm not big into programming, but I took this course hoping I'd learn something wortwhile. Learning BASIC pretty much is worthless to me, since I want to learn something more along the lines of C++, which I scratched just a bit of.

-RSI
 

Pretender

Banned
Mar 14, 2000
7,192
0
0
Why don't you just take AP Comp Science? C++ all the way. Even Computer I (regular Comp Sci) is only C++, but just slower-paced.
 

RSI

Diamond Member
May 22, 2000
7,281
1
0
Trust me; if I could, I would. There are no options for that here. This is the only computer science course I can take. It didn't say what language they used, so I assumed it would be something more modern than this, but I was wrong.

-RSI
 

Wizkid

Platinum Member
Oct 11, 1999
2,728
0
0
I had the same problem in my school... the only programming course they offered was Turing. I took it for a &quot;joke&quot; class, and what a joke it was. Pretty good for people who don't have any programming experience, but it's too bad that my school doesn't offer something more advanced :(