PDA

Click to See Complete Forum and Search --> : Totally lost


rlm16
Oct 24th, 2007, 12:02 AM
I have to write a program for my physical chemistry lab and I have absolutely no experience with programming. I understand some of the basic commands (print, rem, etc.), but I don't know how to enter information and I don't know how to run programs that I've written. I really pretty much have no idea what I'm doing. Is anyone willing to help? Thanks so much in advance!

rlm16
Oct 24th, 2007, 12:04 AM
I also have freebasic and emergence basic, if that helps...

VBFnewcomer
Oct 24th, 2007, 12:56 AM
Welcome rlm16. :wave:
Sure there are lots of people who can help you it is what this forum is for :)
Don't be confused :confused: and approach the problem bit by bit.
Since this is assignment we would desist from providing the full length codes :cry: instead show you the directions as to how to solve your problems (of course at specific issues coding would be provided).
First state clearly what your teacher asked you to do.
Second what language of progamming you are working on (VB6,VS 2003,VS 2005, C, C++,C# etc)
Third state how much of programmig was taught meaning what commands,looping structures, conditional statements (if..else...endif etc)

Most important if your progamming language is not VB6 or previous versions :eek2: then go to the appropriate forum from the home page (http://www.vbforums.com/)and post your question there :ehh: else continue in this forum.
Happy programming :afrog:

We do not do home work :duck:

Hack
Oct 24th, 2007, 05:32 AM
Moved to Other Basic

What is free basic? I've never heard of that.

rlm16
Oct 24th, 2007, 08:57 AM
Nothing was taught in class, bu we are given a sample program (without explanation).

I'm using BASIC, but I'm not sure what version. We were given a link to download Chipmunk BASIC. I have a PC with Windows XP.

We are supposed to write a program that will makes least-squares calculations to analyze data from an experiment. I have been able to figure out certain commands, like rem and print and I get the basic idea, but I can't even figure out how to execute, open, or save programs in the Chipmunk program. I think we should start there. Thanks again for your help! I'm not trying to get someone to write this for me, I just need a little tutoring to be able to write it myself.

rlm16
Oct 24th, 2007, 09:11 AM
I just downloaded another program that I understand more. I can now write a simple program to count to ten and save and run it.

Al42
Oct 24th, 2007, 10:48 AM
In order for us to give you any help, we'd have to be able to run the basic interpreter you're running. Chipmunk is very different from, say, VB. Include a link to the download for whatever interpreter you decide to write the program in, so anyone who wants to help you can download it and give you more than generic advice (like "Save the code you've just entered, however theinterpreter saves it).

rlm16
Oct 24th, 2007, 04:00 PM
I am now using Liberty BASIC, which can be downloaded at
http://www.libertybasic.com/download.html

I have learned several commands and I can now write very basic (no pun intended) programs. For example, I just wrote this:

REM This is a program for calculating sales tax

[Home]
INPUT "Enter item price: "; amount
IF amount=0 THEN GOTO [Instructions]
LET tax=amount*0.05
PRINT
PRINT "Price: "; amount
PRINT "Sales Tax: "; tax
PRINT "Total: "; amount+tax
PRINT
GOTO [Home]

[Instructions]
CLS
PRINT "This is a program for calculating sales tax and totals."
PRINT "When asked to enter item price, enter the price listed on the item."
PRINT "Hit Enter and the price, sales tax, and total should appear"
PRINT
GOTO [Home]

Sorry, I can't remember what I'm supposed to type to denote code.

rlm16
Oct 24th, 2007, 04:46 PM
I was just able to program this:

'This is an integer guessing game.

[Instructions]
PRINT
PRINT "This is a guessing game. I pick a random integer between 1 and 100 and you try to guess what it is."
PRINT "If you guess correctly, you win!"
PRINT "If you guess incorrectly, I will tell you higher or lower to help you get the right answer."
PRINT "When you win, I will tell you how many guesses it took."
PRINT "Let's start!"
PRINT
PRINT "Ready?"

[PickInteger]
answer=int(rnd(1)*100)+1

[Guess]
LET count=count+1
INPUT "Guess an integer between 1 and 100. Then press Enter. "; guess
IF guess=answer THEN GOTO [Win]
IF guess<answer THEN GOTO [Higher]
IF guess>answer THEN GOTO [Lower]

[Higher]
PRINT
PRINT "Higher!"
GOTO [Guess]

[Lower]
PRINT
PRINT "Lower!"
GOTO [Guess]

[Win]
CLS
BEEP
BEEP
BEEP
PRINT
PRINT "You won!"
PRINT "The correct answer is "; answer; "."
PRINT "It took you "; count; " guesses to get the right answer."
PRINT
LET count=0
INPUT "Would you like to play again (Y/N)? 6"; again$
IF instr("Yesyes", again$)>0 THEN GOTO [PickInteger]

[End]
PRINT
PRINT "Thanks for playing!"

This is fun!