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 


CONTEST!!!**JAVA PROGRAM**

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
Kingdom
Grandmaster Cheater Supreme
Reputation: 0

Joined: 16 Jan 2007
Posts: 1638

PostPosted: Fri Apr 11, 2008 6:42 am    Post subject: CONTEST!!!**JAVA PROGRAM** Reply with quote

First person to finish gets a rep =)

Well here it is:

Write a program that prompts the user for a single character. Determine if the character is an upper case letter, a lower case letter, a digit or a symbol. Display a message accordingly. Display an error message if the user inputs more than one character.
Hint: Use the Character class.

Enjoy!

_________________
Back to top
View user's profile Send private message MSN Messenger
NothingToShow
Grandmaster Cheater Supreme
Reputation: 0

Joined: 11 Jul 2007
Posts: 1579

PostPosted: Fri Apr 11, 2008 7:22 am    Post subject: Reply with quote

What for?
Back to top
View user's profile Send private message
lurc
Grandmaster Cheater Supreme
Reputation: 2

Joined: 13 Nov 2006
Posts: 1900

PostPosted: Fri Apr 11, 2008 7:55 am    Post subject: Reply with quote

Dude, the reason they assign this to you is so you can learn it for yourself. You won't learn shit if everyone does it for you -_-
_________________
Back to top
View user's profile Send private message
DoomsDay
Grandmaster Cheater
Reputation: 0

Joined: 06 Jan 2007
Posts: 768
Location: %HomePath%

PostPosted: Fri Apr 11, 2008 10:45 am    Post subject: Reply with quote

You could use Character.isUpperCase() for that comparison, but you should do it by yourself, we are here to help people who are trying to learn, not to help them copy\paste.

As for a hint:
take a look at an ascii table and use int typecast on the character.
Back to top
View user's profile Send private message
Ophiophagous
How do I cheat?
Reputation: 0

Joined: 16 Jan 2007
Posts: 1
Location: Seattle

PostPosted: Fri Apr 11, 2008 5:21 pm    Post subject: Reply with quote

import java.util.Scanner;
import java.lang.Character;

public class win
{
public static void main (String[] args)
{
String leet;
Scanner scan = new Scanner(System.in);
System.out.println("Enter your string, mother fucka: ");
leet = scan.next();
char soss = leet.charAt(0);
if (leet.length() > 1)
System.out.println("error, more than one character");
else
{
if (Character.isLowerCase(soss))
System.out.println("lowercase letter");

if (Character.isUpperCase(soss))
System.out.println("Uppercase letter");

if (Character.isDigit(soss))
System.out.println("Digit");

if (!Character.isDigit(soss) && !Character.isLetter(soss))
System.out.println("Symbol");
}

}
}
Very Happy need some java practice for AP test cause i r teh suck..
Back to top
View user's profile Send private message
Kingdom
Grandmaster Cheater Supreme
Reputation: 0

Joined: 16 Jan 2007
Posts: 1638

PostPosted: Wed Apr 16, 2008 7:05 am    Post subject: Reply with quote

Gave you your rep as promised.

=)

_________________
Back to top
View user's profile Send private message MSN Messenger
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming 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