Arrogance 0 #1 Posted September 9, 2011 [code] import java.io.*; class Conversation { public static void main(String[] args) throws IOException { BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); int myAge = 15; System.out.println("What is your name?"); String name = in.readLine(); System.out.println("Your name is " + name + ", great name."); System.out.println("How old are you?"); String age = in.readLine(); System.out.println("You are " +age+"."); System.out.print("If you added our ages together we would be" + (age + myAge) + " :)"); System.out.println("What is your favorite hobbie?"); String hobby = in.readLine(); System.out.println("What do you like about " + hobby+"?"); String otherHobby = in.readLine(); System.out.println("So what you're saying about " + otherHobby + " is neat."); System.out.println("Well it was nice talking to you"); System.out.println("Please rate this program 1 - 10"); System.out.println("Type a number:"); String rating = in.readLine(); int value = Integer.parseInt(rating); if (value > 5) { System.out.println("You voted: "+value+"."); } else { System.out.println("You voted: "+value+"."); } System.out.println("End of program"); } } [/code] Share this post Link to post Share on other sites
Arrogance 0 #3 Posted September 9, 2011 [quote name='Caelum']Good job.[/QUOTE] Thanks man, I appreciate it. Share this post Link to post Share on other sites
Caelum 0 #4 Posted September 9, 2011 You know those books that leave words left out so you can fill them in yourself? This is practically that, it can easily be turned into something dirty. Again good job, but you can do better. Share this post Link to post Share on other sites
Arrogance 0 #5 Posted September 9, 2011 [quote name='Caelum']You know those books that leave words left out so you can fill them in yourself? This is practically that, it can easily be turned into something dirty. Again good job, but you can do better.[/QUOTE] Those are called ad-libs :P Share this post Link to post Share on other sites
Trey 0 #7 Posted September 9, 2011 You may want to check out java.util.Scanner for easier input from console or files. Share this post Link to post Share on other sites