News:

How did you even find this place?

Main Menu

Help!

Started by skip, November 15, 2006, 12:42:45 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

skip

with QBasic.

"Assume that your money is invested in an account that draws interest compounded annually. That is, at the end of each year the amount invested (principle) is multiplied by the interest rate, and that interest amount is added to the principle. Write a program, using a FOR.. NEXT LOOP, that will get the amount invested, the interest rate, and number of years from the keyboard (INPUT statements). It should then produce a printout showing how much money will be on hand at the end of EACH year."

So far, this is what I have:
Quote
INPUT "Enter amount to invest: ", moneyinvested
INPUT "Enter the interest rate: ", interestrate
INPUT "Enter number of years to invest: ", years

FOR X = years to 1 STEP -1
           totalmoney = (moneyinvested * interestrate) + moneyinvested
NEXT X

Any help would be appreciated!  :)

abc

Uhh.. I don't think anyone here *uses* or *knows* QBasic.... :P

Miamiandy

I know it a little though I haven't used it in ages. Also, I have a friend who just took a programming class online that for some reason programmed in QBASIC. 

In the loop add "PRINT totalmoney" I think that is what is need. I'll check when I get home and have the program, I think QBASIC is on my computer somewhere. QBASIC is a language that I haven't used in a long time.
Want to meet someone famous?  Cut out this coupon!

___________________

|This coupon good for  \
|ONE FREE hunting        \
|expedition with            /
|Dick Cheney.             /

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

rabbit

I know QBASIC.

Basically you want a /PRINT "You have ", totalmoney/ in there

abc

Ah, Why would you atempt to learn QBasic anyways?

Sidoh

Quote from: dlStevens on November 15, 2006, 01:51:17 PM
Ah, Why would you atempt to learn QBasic anyways?

Probably because he took a class where it was taught.  I can't think of any other reason...

skip

Quote from: Sidoh on November 15, 2006, 02:04:25 PM
Quote from: dlStevens on November 15, 2006, 01:51:17 PM
Ah, Why would you atempt to learn QBasic anyways?

Probably because he took a class where it was taught.  I can't think of any other reason...

Exactly.

@rabbit/Miamiandy: The program is far from finished than by just adding a simple PRINT statement. Re-read the instructions in my first post.  :P

Miamiandy

You also need to another to plug total money back into the equation for every subsequent year following the first one.
Want to meet someone famous?  Cut out this coupon!

___________________

|This coupon good for  \
|ONE FREE hunting        \
|expedition with            /
|Dick Cheney.             /

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

Joe

Quote from: dlStevens on November 15, 2006, 01:51:17 PM
Ah, Why would you atempt to learn QBasic anyways?

Rabbit was around back in the days of QBASIC, I think. In fact, I remember back when Windows 95 was bleeding edge, Windows 3.1 was commonplace, and Visual Basic 3 was the thing to do.
Quote from: Camel on June 09, 2009, 04:12:23 PMI'd personally do as Joe suggests

Quote from: AntiVirus on October 19, 2010, 02:36:52 PM
You might be right about that, Joe.


Miamiandy

The first language I learned was QBASIC and at the time I could use it quite well. Although, this was 8 or so years ago. I was in 3rd or 4th grade at the time I think.
Want to meet someone famous?  Cut out this coupon!

___________________

|This coupon good for  \
|ONE FREE hunting        \
|expedition with            /
|Dick Cheney.             /

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

Warrior

Quote from: Joex86] link=topic=7904.msg99216#msg99216 date=1163719564]
Quote from: dlStevens on November 15, 2006, 01:51:17 PM
Ah, Why would you atempt to learn QBasic anyways?

Rabbit was around back in the days of QBASIC, I think. In fact, I remember back when Windows 95 was bleeding edge, Windows 3.1 was commonplace, and Visual Basic 3 was the thing to do.

Arn't you like 15? So..you were programming at the age of like 8?
One must ask oneself: "do I will trolling to become a universal law?" And then when one realizes "yes, I do will it to be such," one feels completely justified.
-- from Groundwork for the Metaphysics of Trolling

Miamiandy

17 years old. I definitely was doing QBASIC in 4th and 5th. Nothing else till 7th though.
Want to meet someone famous?  Cut out this coupon!

___________________

|This coupon good for  \
|ONE FREE hunting        \
|expedition with            /
|Dick Cheney.             /

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

Warrior

Quote from: Miamiandy on November 16, 2006, 07:04:52 PM
17 years old. I definitely was doing QBASIC in 4th and 5th. Nothing else till 7th though.

Not you, I quoted Joe for a reason :P
One must ask oneself: "do I will trolling to become a universal law?" And then when one realizes "yes, I do will it to be such," one feels completely justified.
-- from Groundwork for the Metaphysics of Trolling

Miamiandy

Want to meet someone famous?  Cut out this coupon!

___________________

|This coupon good for  \
|ONE FREE hunting        \
|expedition with            /
|Dick Cheney.             /

¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯

rabbit

I first learned to program QBASIC and Batch on Windows 3.11/MSDOS and (pwn) for OS/2 :P