Quantcast

BASIC Programming question

Li'l Dave

Monkey
Jan 10, 2002
840
0
San Jose, CA
I have to write a program in BASIC that displays my address 4 times with a blank line in between each one using a counter controlled loop. I can get it to write my adress once, but I have no idea how to make it loop 4 times. Any info would be great, I'm really lost. Thanks.
 

Tenchiro

Attention K Mart Shoppers
Jul 19, 2002
5,407
0
New England
If I was still in middle school I could tell you, but the sands of time has long sice eradicated that knowledge.
 

Li'l Dave

Monkey
Jan 10, 2002
840
0
San Jose, CA
Well first of all I cant even write the loop at all, I have no idea how to do it. For some reason Ridemonkey, the program wont let yours work, I really don't know why. Another thing, how do I write out my address in 3 lines anyhow? Sorry for the dumb questoins, I just need to get past this stuff to go on.
 

sanjuro

Tube Smuggler
Sep 13, 2004
17,373
0
SF
Li'l Dave said:
Well first of all I cant even write the loop at all, I have no idea how to do it. For some reason Ridemonkey, the program wont let yours work, I really don't know why. Another thing, how do I write out my address in 3 lines anyhow? Sorry for the dumb questoins, I just need to get past this stuff to go on.
I hope you aren't planning a long career in computers. I am interviewing for a new job, so it is study study study for me.

Code:
10 FOR I = 1 TO 4
20 PRINT "ADDRESS"
30 PRINT "CITY STATE ZIP"
40 NEXT I
I was also reading in the wiki page about "Modern" Basic http://en.wikipedia.org/wiki/Basic_programming_language, and this would be the code then:

Code:
FOR I = 1 TO 4
PRINT "ADDRESS"
PRINT "CITY STATE ZIP"
NEXT I
 

Li'l Dave

Monkey
Jan 10, 2002
840
0
San Jose, CA
Yeah, I can't believe that they are still teaching BASIC. What do you mean Sanjuro that you hope I am not planning on a long carreer in computers? I'm actualy training to be a mechanical engineer.
 

sanjuro

Tube Smuggler
Sep 13, 2004
17,373
0
SF
Li'l Dave said:
Yeah, I can't believe that they are still teaching BASIC. What do you mean Sanjuro that you hope I am not planning on a long carreer in computers? I'm actualy training to be a mechanical engineer.
I haven't used BASIC in 20 years, but I was able to look it up on Wikipedia and after reading the entry for 5 minutes, able to produce code.

This wasn't a question like "What is the difference between Call by Value vs Call by Name?", but it was like, "I don't know how to write a loop so someone else write it for me".

Keep in mind that 99% of the education I have received from computer science was me looking it up and figuring it out.

If you didn't understand how a "FOR" loop worked, or why "NEXT I" incremented a counter, you should have asked.
 

sanjuro

Tube Smuggler
Sep 13, 2004
17,373
0
SF
amydalayna said:
I too am really suprised they are still teaching BASIC.

whenever I have something I'm trying to program and I can't figure out how I use google groups.

http://www.google.com/grphp?hl=en&tab=wg&q=

it's one of the best resources.
I think it is an useless language, and not a particularily good one for teaching.

I suppose the linear execution is similar to assembly language, but it is easy enough to pick up the logic.
 

amydalayna

Turbo Monkey
Aug 16, 2005
1,507
0
south lake tahoe, ca
sanjuro said:
I think it is an useless language, and not a particularily good one for teaching.

I suppose the linear execution is similar to assembly language, but it is easy enough to pick up the logic.
I agree with your point on it not being a good language for teaching. I learned with VB6 and I think that's a good language to start with.
 

Li'l Dave

Monkey
Jan 10, 2002
840
0
San Jose, CA
I get your point, but this is my first semester even seeing this stuff. We have been doing BASIC for about 2 weeks, and my notes are not really giving me everything that I need. Also, I don't know a good place to try and find the answer that I was looking for, everything that I tried just brought me to a dead end. Sometimes you need to get some specific help from someone to be able to get past something small so you can get to more complex questions.
 

Kornphlake

Turbo Monkey
Oct 8, 2002
2,632
1
Portland, OR
If you're studying mech eng you'll likely look at labview at some point. I feel like it's the easiest programming language for mechie guys to use because everything is laid out as if it were a mechanical object for the most part. Still the loops never seem to work for me the way I imagine.

Good luck with the programming thing, thankfully unless you're wierd you'll only spend a small portion of your career writting code.
 

Li'l Dave

Monkey
Jan 10, 2002
840
0
San Jose, CA
That's what I wanted to hear, programming is borring. Hopefully I wont need to spend hardly any time at all doing it. This is for a basic computer science class, its the first set of problems that we have to do.
 

amydalayna

Turbo Monkey
Aug 16, 2005
1,507
0
south lake tahoe, ca
Li'l Dave said:
That's what I wanted to hear, programming is borring. Hopefully I wont need to spend hardly any time at all doing it. This is for a basic computer science class, its the first set of problems that we have to do.
i will say this:
programming is not always boring. solving problems can be satisfying.
the reason to stay away from programming is not the work. it's the people. bunches of dorks.
except for me that is.
 

sanjuro

Tube Smuggler
Sep 13, 2004
17,373
0
SF
amydalayna said:
i will say this:
programming is not always boring. solving problems can be satisfying.
the reason to stay away from programming is not the work. it's the people. bunches of dorks.
except for me that is.
Dork.
 

sanjuro

Tube Smuggler
Sep 13, 2004
17,373
0
SF
Li'l Dave said:
That's what I wanted to hear, programming is borring. Hopefully I wont need to spend hardly any time at all doing it. This is for a basic computer science class, its the first set of problems that we have to do.
Good luck with Fortran...
 

Li'l Dave

Monkey
Jan 10, 2002
840
0
San Jose, CA
I guess your right, programming isn't always borring. I've been in front of my computer all day trying to get these problems done. And I don't know what you are trying to get at Sanjuro, I just asked a question and you're giving me grief for not knowing as much as you. Thanks but no thanks.
 

sanjuro

Tube Smuggler
Sep 13, 2004
17,373
0
SF
Li'l Dave said:
I guess your right, programming isn't always borring. I've been in front of my computer all day trying to get these problems done. And I don't know what you are trying to get at Sanjuro, I just asked a question and you're giving me grief for not knowing as much as you. Thanks but no thanks.
1. I gave you the answer, and I believe the correct one.

2. I might be giving you a hard time, but I had the same problems you are having when I first learned how to code. No one gave me the answer straight out, but my teachers taught me how to think it out for myself.

If you are having a problem with basic programming concepts, you should ask that. It seemed liked you wanted just the answer, which doesn't teach you very much.

I am sorry if I seem like a jerk (which I am), but understanding loop structures is critical if you want to use programming languages, like Fortran, C, or Java, which are all used in engineering.



BTW, the question I would ask is how does FOR loop work.
 

Li'l Dave

Monkey
Jan 10, 2002
840
0
San Jose, CA
And thank you for the answer, but I don't like being treated like and idiot. And I know just getting the answer doesn't teach me anything, I just wanted to get past the first stupid part so I could go on.