JEFF447
|
  |
| Joined: 24 Apr 2009 |
| Total Posts: 322 |
|
|
| 08 Feb 2012 04:31 PM |
package java.assignement.one; import java.util.Scanner; public class JavaAssignementOne { public static void main(String[] args) // TODO code application logic here { System.out.println("Hello out there."); System.out.println("I will add three numbers for you."); System.out.println("Enter two whole numbers on a line:"); int n1, n2, n3; Scanner keyboard = new Scanner(System.in); n1 = keyboard.nextInt( ); n2 = keyboard.nextInt( ); n3 = keyboard.nextInt( ); System.out.println("The sum of the three numbers is"); System.out.println(n1 + n2 + n3); } }
|
|
|
| Report Abuse |
|
|
|
| 08 Feb 2012 04:31 PM |
| You couldn't have possibly coded that all so fast |
|
|
| Report Abuse |
|
|
| |
|
| |
|
JEFF447
|
  |
| Joined: 24 Apr 2009 |
| Total Posts: 322 |
|
|
| 08 Feb 2012 04:32 PM |
| I had this code saved, I continued work on it today and finished. |
|
|
| Report Abuse |
|
|
| |
|
mustyoshi
|
  |
 |
| Joined: 27 Dec 2007 |
| Total Posts: 41651 |
|
|
| 08 Feb 2012 04:32 PM |
mfw I googled it and it's from Jan 25th 2012 from pastebin.
~Monica |
|
|
| Report Abuse |
|
|
| |
|
|
| 08 Feb 2012 04:33 PM |
| Alright, then explain what the first 4 lines are and why they are important? |
|
|
| Report Abuse |
|
|
mustyoshi
|
  |
 |
| Joined: 27 Dec 2007 |
| Total Posts: 41651 |
|
|
| 08 Feb 2012 04:35 PM |
package java.assignement.one; //The package, it helps with security of functions import java.util.Scanner; //Import some stuff for getting user input public class JavaAssignementOne { //The class public static void main(String[] args) //The main method so can has command line
~Monica |
|
|
| Report Abuse |
|
|
|
| 08 Feb 2012 04:36 PM |
| I wanted OP to explain it :P |
|
|
| Report Abuse |
|
|
mustyoshi
|
  |
 |
| Joined: 27 Dec 2007 |
| Total Posts: 41651 |
|
|
| 08 Feb 2012 04:37 PM |
Sorry. I like posts.
~Monica |
|
|
| Report Abuse |
|
|
LordGando
|
  |
| Joined: 05 Jul 2011 |
| Total Posts: 6723 |
|
| |
|