anyone really good at java

Posts 15 of 5 · Page 1 of 1
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!!!
looks like it should work. try rewriting it.
ive been trying differnt stuff fo liike an hour lol
Quote Originally Posted by Tony Stark` View Post
ive been trying differnt stuff fo liike an hour lol
dont copy and paste anything....type it all out...
@swiftdude i did it all i didnt copy and paste 1 thing
Posts 15 of 5 · Page 1 of 1

Post a Reply

Similar Threads

Tags for this Thread

None

Need help?