Results 1 to 5 of 5
  1. #1
    Tony Stark`'s Avatar
    Join Date
    Nov 2009
    Gender
    male
    Location
    Chicago
    Posts
    5,370
    Reputation
    212
    Thanks
    458

    anyone really good at java

    hey im making a code for my online course and its really screwed i was wondering if anyone can help me
    Code:
    import java.awt.*;
    import hsa.Console;
    
    public class Rcoster
    {
        static Console c;           // The output console
        static int tall;
        static String bp;
         static String heart;
         static int totalScore;
         static int score;
         static int score1;
         static int score2;
        public static void main (String[] args)
        {
            c = new Console ();
            
            
            
            
            c.println("How tall are you in CM?");
                
             tall = c.readInt();
             
             if (tall >=188 )
             {
             c.println("Sorry you are to tall to ride this rollar coaster");
             }
             
             else if (tall <= 122)
             {
             c.println("Sorry you are to short to ride this rollar coaster");
             
             }
              else
             {
             score=1;
            
           
            } 
            
            
            c.println("Do you have any back problems? (Y)(N)"); 
            bp = c.readLine();
             
             
             if (bp=="N") 
             {
             score1=1 ;
            
             }
             
          else if(bp=="Y")
            { 
             c.println("Im sorry we dont want to risk more injury to your back so you may not ride the rollar coaster");
            }
           
             c.println("Do you have any  heart problems? (Y)(N)");
            heart = c.readLine();
            
           if (heart=="N")
         {
         score2=1;
         }
          else if (heart=="Y")
         {
         c.println("Im sorry you may not ride the rollar coaster due to your health problem");
         }
      totalScore= (score+score1+score2);
       c.println(totalScore);
      
       
       if (totalScore==3)
       {
       c.println("Congratulations you may ride the rollar coaster enjoy your trip");
       } 
       
      else if  (score<3)
       
       {
       c.println("You may not ride the rollar coaster");
       }
       
       
        
          // Place your program here.  'c' is the output console
        } // main method
    } // Rcoster class

    for some reason it wont count my score it always = 1 please help!!!
    Last edited by Tony Stark`; 11-11-2011 at 12:00 PM.

  2. #2
    Swiftdude's Avatar
    Join Date
    Apr 2009
    Gender
    male
    Location
    Illinois.
    Posts
    12,572
    Reputation
    1130
    Thanks
    2,982
    My Mood
    Cynical
    looks like it should work. try rewriting it.
    Still love you Giggletron


  3. #3
    Tony Stark`'s Avatar
    Join Date
    Nov 2009
    Gender
    male
    Location
    Chicago
    Posts
    5,370
    Reputation
    212
    Thanks
    458
    ive been trying differnt stuff fo liike an hour lol

  4. #4
    Swiftdude's Avatar
    Join Date
    Apr 2009
    Gender
    male
    Location
    Illinois.
    Posts
    12,572
    Reputation
    1130
    Thanks
    2,982
    My Mood
    Cynical
    Quote Originally Posted by Skyrim View Post
    ive been trying differnt stuff fo liike an hour lol
    dont copy and paste anything....type it all out...
    Still love you Giggletron


  5. #5
    Tony Stark`'s Avatar
    Join Date
    Nov 2009
    Gender
    male
    Location
    Chicago
    Posts
    5,370
    Reputation
    212
    Thanks
    458
    @swiftdude i did it all i didnt copy and paste 1 thing

Similar Threads

  1. Really good daftpunk video
    By IceyFire in forum General
    Replies: 0
    Last Post: 09-03-2008, 10:28 PM
  2. Hey i have a Really good question
    By Andyklk2009 in forum Combat Arms Hacks & Cheats
    Replies: 17
    Last Post: 08-27-2008, 07:43 PM
  3. Replies: 10
    Last Post: 08-08-2008, 02:16 PM
  4. Read . . . . Really good offer.
    By Synns in forum WarRock Korea Hacks
    Replies: 7
    Last Post: 01-07-2008, 03:08 AM
  5. is cs really good ??? betta than warrock??
    By scuartas in forum CounterStrike (CS) 1.6 Hacks / Counter Strike: Source (CSS) Hacks
    Replies: 22
    Last Post: 02-09-2006, 12:02 PM