anandarose 0 Newbie Poster

When I try to run this I get a run time error. Can someone tell me how to get rid of the error? This is due Sunday by midnight so the sooner I get help the better.

Thanks,

Ananda (Uh-non-duh)


'Ananda Bennett '10/26/2007 GOTO [getInput] GOTO [assignRiskCode] GOTO [determineRisk] GOTO [printOutput] [getInput] print "What is your name?" read name$ print "How old are you?" read age if age <= 16 then print "Invalid entry" end if print "How many traffic violatlons do you have?" read viols if viols < 0 then print "Invalid entry" end if [determineRiskCode] if viols >= 4 then let riskcode = 1 end if if viols = 3 then let riskcode = 2 end if if viols = 2 then let riskcode = 2 end if if viols = 1 then let riskcode = 3 end if if viols = 0 then let riskcode = 4 end if [assignRiskLevel] if riskcode = 1 then let risklevel$ = "High" end if if riskcode = 2 then let risklevel$ = "Moderate" end if if riskcode = 3 then let risklevel$ = "Low" else let risklevel$ = "No" End If [printOutput] if age < 25 then if viols >= 4 then print name$ ; ", as a " ;risklevel$ ; "risk driver, your insurance will cost $480.00." end if end if if age > 25 then if viols >= 4 then print name$ ; ", as a " ;risklevel$ ; "risk driver, your insurance …

anandarose 0 Newbie Poster

Please Help Me!

anandarose 0 Newbie Poster

QVeen72, you've been asked multiple times to use code tags. Is there a problem with understanding what they are? How to use them? Where to get the information? All this has been mentioned... Check the post at the top if the forum labled Please use BB Code and Inlinecode tags

Thank you for posting that. I'm new to programing so when I read QueenV's response I thought either there was something wrong with me or i just wasn't geek enough yet to understand it. :p

Thanks again,

Ananda :twisted:

anandarose 0 Newbie Poster

Those two words were meant for each other. :cheesy: Anyways, i got the final on Wednesday and it's due next Wednesday.

I have to design a program that takes information from a text document, displays that information, makes calculations based on that information, and then prints those calculations in a separate text document. The document LarryLemon.txt is the record of all cars sold at a used car lot. With each car sold the following variables were recorded in the document: VehiclePrice, LastName$, FirstName$, Phone, Address, City$, State$, ZIP, and Salesperson$.

I have written the following code so far:

'Ananda Bennett
'12/06/06
'Sales program

OPEN "c:\LarryLemon.txt" FOR INPUT AS #1

DO WHILE EOF(#1) <> -1
INPUT #1, VehiclePrice, LastName$, FirstName$, Phone, Address, City$, State$, ZIP, Salesperson$

PRINT "VehiclePrice  LastName  FirstName  Phone  Address  City  State  ZIP  Salesperson"
PRINT "................................................................................................"
PRINT VehiclePrice; "  " ;LastName$; "  " ;FirstName$; "  " ;Phone; "  " ;Address; "  " ;City$; "  " ;State$; "  " ;ZIP; "  " ;Salesperson$
PRINT "                                                                                                "

LOOP

CLOSE #1

The code above only displays the information in the LL.txt file. The three calculations that I need to make are totaling how many cars each sales person sold, the total of their sales, and the average cost of a car he or she sold. Along with the sales persons name, the other two calculations need to be sent to a file for each sales person.

In order to count the total of cars sold by each sales …

anandarose 0 Newbie Poster

>>I really hate asking this but could someone do this for me? I absolutely despise programing

Nope. If you don't want to do it then drop the class and take something else, such as basket weaving, that you might enjoy better. No point in doing something that you hate.

If I don't pass this class I can't get my degree. Trust me, i wouldn't take this class unless it was absolutely necessary.I would love to be basket weaving instead.

>>i'm a quadrapelegic


If that is true, how do you do computer programming? If have seen films on TV about quadrapelegic using a computer with something in the mouth to control the keyboard, but it is highly unlikely they can program computers.

I am a C1/C2 quadrapelegic from a brain stem stroke in the year 2000. My computer interface is a joystick that I push with my chin. It "talks" to the computer via an infrared display module that is attached to my chair. That enables me to move the mouse as effortlessly as you do. As for typing and clicking, Google "Keystrokes". You can see my chin switch in the pictures on my homepage: www.homepage.mac.com/rosiebennett


Ananda :twisted:

anandarose 0 Newbie Poster

I really hate asking this but could someone do this for me? I absolutely despise programing. I don't want to be a programer! The only reason i'm taking it is because it's required for the Web Technologies degree. I have checked with the other curiculum and I will not have any other programing classes. This is my last program before the final. If I don't get a C or higher i won't pss. I had all intentions of finishing the program myself but mmy dad's PC unexpectedly had to go get repaired this week. I don't have any other PC'S available because all we have are Macs. I can't go to the public library tonight because I don't have someone available to take me. (i'm a quadrapelegic so I can't do anything without some assistance. Please! I'm begging for help! If you help me, after this class is over, i will never post on this part of the forum again.

Thanks,

Ananda

anandarose 0 Newbie Poster

i totally didn't understand what you were trying to say. Go back and actually spell the words out.

anandarose 0 Newbie Poster

I really need some help with this! I'm lost!

anandarose 0 Newbie Poster

Here is another INPUT information output program. The first 3 select cases work correctly. I attempted the 4th and 7th select cases but they are not working correctly, i would appreciate any feedback i get, even if it's "I don't have a freaking clue." Could you guys help a girl out?

Thanks,

Ananda

Here is the code so far: (The NCAAdata.txt file and a more thurogh description of the program and it's perametors are attached)

'Ananda Bennett
'11/29/06
'NCAA


OPEN "c:\ncaadata.txt" FOR INPUT AS #1

'VARIABLE DESCRIPTIONS:
'Year           Columns 1-4
'Winning School Columns 6-24
'Winning Score  Columns 25-27
'Losing School  Columns 29-47
'Losing Score   Columns 48-50

'Numeric Variables:  Year, Winning Score, Losing Score
'String Variables:  Winning School, Losing School

'SPECIAL NOTES:
'The last game listed for each year is the championship game.
LET lowscore = 1000
PRINT"**********************************************************************************************************************************************************************************************"
PRINT"***** 1 - Total number of games where losing team scored more than 100 pts                                                                                                               *****"
PRINT"***** 2 - Total number of games where a team scored more than 100 pts     ***** *****"
PRINT"***** 3 - Total number of games won and lost by Kentucky (games won - games lost)*****"
PRINT"***** 4 - Lowest total points scored by both teams in a single NCAA Tournament game*****" '(include game information)
PRINT"***** 5 - Highest number of points scored by a single team in a game*****" '(include game information).
PRINT"***** 6 - Largest margin of victory*****" '(include game information)
PRINT"***** 7 - Average score of winning team and average score of …
anandarose 0 Newbie Poster

Hi,

sorry, i forgot to tell u after end select, close the text file .

Regards

Veena

Thank you very much!

anandarose 0 Newbie Poster

The following code is supposed to use the data in the attatched file to generate a list of relavent houses available based on the specifacations that you enter. After I enter my prefered search method I can't get it to stop asking me how many bed/bathrooms or what price i want to search for. Could you guys help me out?

Here is the code:

'Ananda Bennett
'11/06/2006
'HHSS
OPEN "c:\homes.txt" FOR INPUT AS #1
PRINT"************************************"
PRINT"* 1 - Search by number of bedrooms *"
PRINT"* 2 - Search by number of bathrooms*"
PRINT"* 3 - Search by price *"
PRINT"************************************"
INPUT "What would you like to search for homes by?: "; schoice
CLS
DO WHILE EOF(#1) <> -1
INPUT #1, address$, city$, state$, proptype$, bedrooms, bathroom, price
SELECT CASE schoice
CASE 1
INPUT "How many bedrooms would you like to search by?; "; bedquant
IF bedquant = bedroom THEN
PRINT "Address: "; address$
PRINT "City: "; city$
PRINT "State: "; state$
PRINT "Prop. Type: "; proptype$
PRINT "Bedrooms: "; bedrooms; "Bathrooms: "; bathrooms; "Price: "; price;
PRINT "-----------------------------------------------------------------"
END IF
CASE 2
INPUT "How many bathrooms would you like to search by?; "; bathquant
IF bathquant = bedroom THEN
PRINT "Address: "; address$
PRINT "City: "; city$
PRINT "State: "; state$
PRINT "Prop. Type: "; proptype$
PRINT "Bedrooms: "; bedrooms; "Bathrooms: "; bathrooms; "Price: "; price;
PRINT "-----------------------------------------------------------------"
END IF
CASE 3
INPUT "What price would you like to search by?; "; prices
IF prices = price THEN
PRINT …
anandarose 0 Newbie Poster
The following code is supposed to use the data in the attatched file to generate a list of relavent houses available based on the specifacations that you enter. After I enter my prefered search method I can't get it to stop asking me how many bed/bathrooms or what price i want to search for. Could you guys help me out?
 
Here is the code:
 
'Ananda Bennett
'11/06/2006
'HHSS
OPEN "c:\homes.txt" FOR INPUT AS #1
PRINT"************************************"
PRINT"* 1 - Search by number of bedrooms *"
PRINT"* 2 - Search by number of bathrooms*"
PRINT"* 3 - Search by price *"
PRINT"************************************"
INPUT "What would you like to search for homes by?: "; schoice
CLS
DO WHILE EOF(#1) <> -1
INPUT #1, address$, city$, state$, proptype$, bedrooms, bathroom, price
SELECT CASE schoice
CASE 1
INPUT "How many bedrooms would you like to search by?; "; bedquant
IF bedquant = bedroom THEN
PRINT "Address: "; address$
PRINT "City: "; city$
PRINT "State: "; state$
PRINT "Prop. Type: "; proptype$
PRINT "Bedrooms: "; bedrooms; "Bathrooms: "; bathrooms; "Price: "; price;
PRINT "-----------------------------------------------------------------"
END IF
CASE 2
INPUT "How many bathrooms would you like to search by?; "; bathquant
IF bathquant = bedroom THEN
PRINT "Address: "; address$
PRINT "City: "; city$
PRINT "State: "; state$
PRINT "Prop. Type: "; proptype$
PRINT "Bedrooms: "; bedrooms; "Bathrooms: "; bathrooms; "Price: "; price;
PRINT "-----------------------------------------------------------------"
END IF
CASE 3
INPUT "What price would you like to search by?; "; prices
IF prices = price THEN
PRINT …
anandarose 0 Newbie Poster

THANK YOU SO MUCH FOR YOUR HELP!

:cheesy: :mrgreen: :) :!: :confused: :lol: :p

anandarose 0 Newbie Poster

Thanks!

anandarose 0 Newbie Poster

Thanks for the warm welcome!

anandarose 0 Newbie Poster

Here is the improved code after incorperating your advice and the advice of my professor. It does everything except display the correct maximum consecutive head and tail count. I am open to any advice. Once again it is greatly appreciated.

Ananda

'Ananda Bennett
'10/11/2006
'Heads or tails program

INPUT "How many times do you want to flip the coin?: " ;flipq
IF flipq < 1 THEN
        PRINT "You must flip the coin at least 1 time"
    END IF

DO WHILE count < flipq
            LET num=INT(RND(0)*2)+1
            LET count = count + 1
            IF num = 1 THEN
                PRINT "T"
                LET tcount = tcount +1
                LET maxtcount = tcount
                    IF maxtcount > tcount THEN
                        LET maxtcount = maxtcount
                    END IF
            ELSE
                PRINT "H"
                LET hcount = hcount + 1
                LET maxhcount = hcount
                    IF maxhcount > hcount THEN
                        LET maxhcount = maxhcount
                    END IF
            END IF
LOOP

PRINT "t count: " ;tcount; " h count: ";hcount

PRINT "The maximum number of consecutive heads for " ; flipq; " coin flips is: " ;maxhcount
PRINT "The maximum number of consecutive tails for " ; flipq; " coin flips is: " ;maxtcounta
anandarose 0 Newbie Poster
DO WHILE count < flipq
    LET num=INT(RND(0)*2)+1
    IF num = 1 THEN
        PRINT "T"
        'LET count = count + 1      ' put this before the IF
        'LET tcount = tcount + 1    ' uncomment this and duplicate it for heads
        'LET maxtcount = tcount
        'IF maxtcount > tcount THEN
        'LET maxtcount = maxtcount
        'END IF
      ELSE
          PRINT "H"
      END IF
LOOP

Initialize tcount and hcount before the while loop.

Thank you for your help. Your advice massively improved my program. But I have another question: what do you mean by initialize? Please don't repremand me for asking. I feel bad enough about having to ask for help already. Haha.

Ananda

anandarose 0 Newbie Poster

I agree. Are they really teaching LET for VB? Or is this another version of BASIC? Maybe best in Legacy and Other Languages
.

The software is called Liberty Basic. Www.libertybasic.com

anandarose 0 Newbie Poster

Hi everyone! I would really appreciate any help that I can get on this problem.

My professor asigned us a project where you create a program that essentially simulates coin flips. The first step in the program is to ask the user how many times they want to flip the coin. Regardless of how many times they choose to flip the coin the program needs to print the result of each flip whether it's heads or tails. I have all of that done i can't figure out how to implement the last step which is to display the maximum consecutive heads and tails that appear in the results from the coin toss'.

Here is the code that I have so far:

'10/11/2006
'Heads or tails program
INPUT "How many times do you want to flip the coin?: " ;flipq
IF flipq < 1 THEN
        PRINT "You must flip the coin at least 1 time"
    END IF
DO WHILE count < flipq
            LET num=INT(RND(0)*2)+1
            IF num = 1 THEN
                PRINT "T"
                        'LET count = count + 1
                            'LET tcount = tcount + 1
                                'LET maxtcount = tcount
                                    'IF maxtcount > tcount THEN
                                        'LET maxtcount = maxtcount
                                    'END IF
            ELSE
                PRINT "H"
            END IF
LOOP
 
PRINT tcount;
'PRINT "The maximum number of consecutive heads for " flipq; "coin flips is: " ;hcount
'PRINT "The maximum number of consecutive for " flipq; "coin flips is: " ;tcount
anandarose 0 Newbie Poster

Name: Ananda (Uh•non•duh)
Nickname: Ananda Rose, Rosie, Rose, Nonny, Nonny Rose
Height: 5'2''
Weight: 130
Hair: Brown
Eyes: Blue
Location: NC
Age: 18

Hobbies: Listening to music, design, going out with friends and family, movies, laughing, sleeping, digital art, graphic design, web design

Relationship Status: in love with my bf

Education: i am currently a Web technologies student at GTCC.

"Quad by stroke, stubborn bi†©h by reputation." :twisted: