Guest h4344 Posted September 13, 2011 Share Posted September 13, 2011 This is what i have so far: import java.util.Scanner; public class Test { public static void main(String []args) { Scanner scan = new Scanner(System.in); double answer = 0; System.out.println("-----------------"); System.out.println("Created By h4344"); System.out.println("-----------------"); while (answer != 4){ double fnum = 0, snum = 0; System.out.println("What 2 numbers = 4?"); System.out.println("Enter First Number: "); fnum = scan.nextDouble(); System.out.println("Enter Second Number: "); snum = scan.nextDouble(); answer = fnum + snum; if(answer == 4) { System.out.println(answer); System.out.println("Your Answers Were Correct"); System.out.println("Done!"); } else{ System.out.println(answer); System.out.print("Your Answers Were Wrong!"); System.out.println("Try Again!"); System.out.println(); } } } } Working on making it a simple math program but looking good so far. Ty to Capt.Xander for helping me out with some of the lines. :D Link to comment Share on other sites More sharing options...
Guest MAJ.Spartan-S63=US= Posted September 13, 2011 Share Posted September 13, 2011 It would help if you used the code tags to wrap the code. But it looks like a cool Java program. We'll have to get together sometime so I can teach you more. Link to comment Share on other sites More sharing options...
Guest h4344 Posted September 13, 2011 Share Posted September 13, 2011 I might need your help with something if you get the time. Link to comment Share on other sites More sharing options...
Guest corriz Posted September 13, 2011 Share Posted September 13, 2011 Realy good. Programming is learning for all your life. The beginnings are difficult, but the reward is beautiful. Btw, I would like to join to your lessons. Link to comment Share on other sites More sharing options...
Guest mbradley672 Posted September 27, 2011 Share Posted September 27, 2011 Nice work. I'm actually a C# developer but do have experience with Java and would also love to help anyone out there that woudl like to learn either. Link to comment Share on other sites More sharing options...
Guest Ret.Maj.Xander=US= Posted September 28, 2011 Share Posted September 28, 2011 you can use the {code} tags (use '[ ]' instead of '{ }')in the forum and that will stay formatted like so import java.util.Scanner; public class Test { public static void main(String []args) { Scanner scan = new Scanner(System.in); double answer = 0; System.out.println("-----------------"); System.out.println("Created By h4344"); System.out.println("-----------------"); while (answer != 4){ double fnum = 0, snum = 0; System.out.println("What 2 numbers = 4?"); System.out.println("Enter First Number: "); fnum = scan.nextDouble(); System.out.println("Enter Second Number: "); snum = scan.nextDouble(); answer = fnum + snum; if(answer == 4) { System.out.println(answer); System.out.println("Your Answers Were Correct"); System.out.println("Done!"); } else{ System.out.println(answer); System.out.print("Your Answers Were Wrong!"); System.out.println("Try Again!"); System.out.println(); } } Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.