Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


Help with java

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> Random spam
View previous topic :: View next topic  
Author Message
PUSHEAX_PUSHEAX
Grandmaster Cheater
Reputation: 72

Joined: 13 Apr 2009
Posts: 969

PostPosted: Sat May 08, 2010 9:22 am    Post subject: Help with java Reply with quote

I can't seem to add an else statement without getting errors, any help?

Code:
import java.util.Scanner;

class math {
   public static void main (String args[]){
      Scanner greg = new Scanner(System.in);
      double  tuna;
      System.out.print("Please enter a number to be assigned to tuna: ");
      tuna = greg.nextDouble();
      if (tuna >= 10);{
         System.out.println("Tuna is less than or equal to 10!");
      
      }
      
   }
}
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Sat May 08, 2010 9:28 am    Post subject: Reply with quote

Why do you have a semi-colon after your if statement
Back to top
View user's profile Send private message
Steve03416634
Grandmaster Cheater
Reputation: 0

Joined: 12 Dec 2006
Posts: 846

PostPosted: Sat May 08, 2010 9:28 am    Post subject: Reply with quote

Code:


if (a == true) {
    a = false;
} else if (a == false) {
    a = true;
} else {
System.out.print("WHAT ARE YOU DOING.");
}

Back to top
View user's profile Send private message
PUSHEAX_PUSHEAX
Grandmaster Cheater
Reputation: 72

Joined: 13 Apr 2009
Posts: 969

PostPosted: Sat May 08, 2010 9:31 am    Post subject: Reply with quote

Slugsnack wrote:
Why do you have a semi-colon after your if statement

Oh, I'm still learning, thanks.
Back to top
View user's profile Send private message
Stylised
Grandmaster Cheater
Reputation: 20

Joined: 04 Nov 2008
Posts: 712

PostPosted: Sat May 08, 2010 9:31 am    Post subject: Reply with quote

Inb4 delete hall.dll to make it work.
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Sat May 08, 2010 9:48 am    Post subject: Reply with quote

Geert Wilders wrote:
Code:


if (a == true) {
    a = false;
} else if (a == false) {
    a = true;
} else {
System.out.print("WHAT ARE YOU DOING.");
}


that's the most disgusting piece of code I've seen in my whole life excluding iPromise and void's handiwork.
Back to top
View user's profile Send private message
Steve03416634
Grandmaster Cheater
Reputation: 0

Joined: 12 Dec 2006
Posts: 846

PostPosted: Sat May 08, 2010 9:57 am    Post subject: Reply with quote

Slugsnack wrote:
Geert Wilders wrote:
Code:


if (a == true) {
    a = false;
} else if (a == false) {
    a = true;
} else {
System.out.print("WHAT ARE YOU DOING.");
}


that's the most disgusting piece of code I've seen in my whole life excluding iPromise and void's handiwork.


You're welcome.
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Sat May 08, 2010 10:05 am    Post subject: Reply with quote

Although judging from your posts in the past.. maybe you should consider mastering English before you start with other languages.
Back to top
View user's profile Send private message
Steve03416634
Grandmaster Cheater
Reputation: 0

Joined: 12 Dec 2006
Posts: 846

PostPosted: Sat May 08, 2010 10:06 am    Post subject: Reply with quote

Slugsnack wrote:
Although judging from your posts in the past.. maybe you should consider mastering English before you start with other languages.


I stand insulted.
Back to top
View user's profile Send private message
PUSHEAX_PUSHEAX
Grandmaster Cheater
Reputation: 72

Joined: 13 Apr 2009
Posts: 969

PostPosted: Sat May 08, 2010 10:06 am    Post subject: Reply with quote

Man Java is easier than C++, I actually get Java unlike C++.

Code:
import java.util.Scanner;

class math {
   public static void main(String args[]){
      Scanner greg = new Scanner(System.in);
      double boy, girl;
      System.out.print("Please enter your age(male): ");
         boy = greg.nextDouble();
      System.out.println("Please enter your age(girl): ");
         girl = greg.nextDouble();
         if(boy < 18 && girl <18){
            System.out.println("you may enter, young buck");
         }else{
            System.out.println("You may not enter, old cat");
         }
      
      
   }
}
Back to top
View user's profile Send private message
Womanizer
Grandmaster Cheater
Reputation: 2

Joined: 30 May 2009
Posts: 958

PostPosted: Sat May 08, 2010 10:35 am    Post subject: Reply with quote




712417683.jpg
 Description:
 Filesize:  353.79 KB
 Viewed:  4920 Time(s)

712417683.jpg


Back to top
View user's profile Send private message
Cheat Engine User
Something epic
Ban
Reputation: 60

Joined: 22 Jun 2007
Posts: 2071

PostPosted: Sat May 08, 2010 11:01 am    Post subject: Reply with quote

Code:
import java.util.Scanner;

class math {
   public static void main(String args[]){
      Scanner greg = new Scanner(System.in);
      double boy, girl;
      System.out.print("Please enter your age(male): ");
         boy = greg.nextDouble();
      System.out.println("Please enter your age(girl): ");
         girl = greg.nextDouble();
         if(boy < 18 && girl <18) System.out.println("you may enter, young buck");
         else   System.out.println("You may not enter, old cat");
   }
}
I think this edit should work. Also, why the double?
Back to top
View user's profile Send private message
Aniblaze
Grandmaster Cheater Supreme
Reputation: 138

Joined: 23 Apr 2006
Posts: 1757
Location: The Netherlands

PostPosted: Sat May 08, 2010 11:27 am    Post subject: Reply with quote

Holland wrote:
Code:
import java.util.Scanner;

class math {
   public static void main(String args[]){
      Scanner greg = new Scanner(System.in);
      double boy, girl;
      System.out.print("Please enter your age(male): ");
         boy = greg.nextDouble();
      System.out.println("Please enter your age(girl): ");
         girl = greg.nextDouble();
         if(boy < 18 && girl <18) System.out.println("you may enter, young buck");
         else   System.out.println("You may not enter, old cat");
   }
}
I think this edit should work. Also, why the double?

Defining the type is a must in Java. You might notice this while we will be programming together as well. I will almost always use:

Code:
(String) $var = "";


Because I've learned to do so in Java.
Back to top
View user's profile Send private message
Slugsnack
Grandmaster Cheater Supreme
Reputation: 71

Joined: 24 Jan 2007
Posts: 1857

PostPosted: Sat May 08, 2010 12:48 pm    Post subject: Reply with quote

I think he means why double and not int
Back to top
View user's profile Send private message
CrisNMP
Fun Supervisor
Reputation: 16

Joined: 11 Apr 2007
Posts: 4649

PostPosted: Sat May 08, 2010 12:49 pm    Post subject: Reply with quote

Slugsnack wrote:
Why do you have a semi-colon after your if statement

Its a winking sad face ;{

_________________

BENBENBENBENBENBENBENBEN
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> Random spam All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites