|
-
Oct 24th, 2007, 12:02 AM
#1
Thread Starter
New Member
Totally lost
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!
-
Oct 24th, 2007, 12:04 AM
#2
Thread Starter
New Member
Re: Totally lost
I also have freebasic and emergence basic, if that helps...
-
Oct 24th, 2007, 12:56 AM
#3
Frenzied Member
-
Oct 24th, 2007, 05:32 AM
#4
Re: Totally lost
Moved to Other Basic
What is free basic? I've never heard of that.
-
Oct 24th, 2007, 08:57 AM
#5
Thread Starter
New Member
Re: Totally lost
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.
-
Oct 24th, 2007, 09:11 AM
#6
Thread Starter
New Member
Re: Totally lost
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.
-
Oct 24th, 2007, 10:48 AM
#7
Re: Totally lost
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).
The most difficult part of developing a program is understanding the problem.
The second most difficult part is deciding how you're going to solve the problem.
Actually writing the program (translating your solution into some computer language) is the easiest part.
Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.
Please Help Us To Save Ana
-
Oct 24th, 2007, 04:00 PM
#8
Thread Starter
New Member
Re: Totally lost
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.
-
Oct 24th, 2007, 04:46 PM
#9
Thread Starter
New Member
Re: Totally lost
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!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|