Need Help With My Program

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hjc
    New Member
    • Oct 2006
    • 14

    #1

    Need Help With My Program

    I AM TRYING FIGURE OUT A PROGRAM THAT COUNT THE NUMBER OF PEOPLE WHO GET OFF A TRAIN EACH TIME IT STOPS AT A SPECIFIC LOCATION
    THIS IS MY CODE:
    <html><head><ti tle>Javascript</title></head>
    <body>
    <h1>Javascrip t example 1</h1>
    <script language="JavaS cript">


    var count = 0;
    var max = 0;
    var min = 0;
    var total = 0;
    var avg = 0;
    var passengers = 0;
    var continue = true;

    continue == confirm("Do you want to play?");

    if(continue==tr ue)
    {
    alert("lets play");
    }
    else
    }
    alert("see ya, peace out!");
    }

    while(continue= =true)
    {
    passengers = parseInt(prompt ("how many people got off the train?"));
    count++;
    if(count == 1)
    {
    max = passengers;
    min = passengers;
    }
    if(max < passengers)
    {
    max = passengers;
    }
    if(min > passengers)
    {
    min = card;
    }
    total = total + passengers;
    continue=confir m("play again?");
    }
    if(continue == true)
    {
    alert(“get continue”);
    }
    else
    {
    total = total / avg;
    }
    document.write( max, min, total, avg, count);

    </script>
    <p>Regular page content</p>

    </body>
    </html>
  • steven
    New Member
    • Sep 2006
    • 143

    #2
    Originally posted by hjc
    I AM TRYING FIGURE OUT A PROGRAM THAT COUNT THE NUMBER OF PEOPLE WHO GET OFF A TRAIN EACH TIME IT STOPS AT A SPECIFIC LOCATION
    Okay, and?

    You haven't told us what your problem is. Also note that we're not here to complete your homework assignments for you, so, after you actually tell us what the problem is, go ahead and tell us what you've done to try and solve the problem.

    Comment

    • hjc
      New Member
      • Oct 2006
      • 14

      #3
      sorry to bother you-i didn't want anything done other than to know if the code is set up right. I have a flow chart and have the problem figured out, that is why i didn't include the entire question. like i said just looking to have someone look at my code

      Comment

      Working...