import java.util.Scanner;
//***********************************************
// ASSIGNMENT #: 2
// PROBLEM #: 1
// PROGRAM-NAME: AddTen
//***********************************************
class AddTen {
/**
* The start point of the program
* @param args
*/
public static void main(String[] args){
//The Scanner class is used to get the user input
Scanner keyBoard =new Scanner(System.in);
//Declare variables as integers, initialize variables with values
System.out.print("Enter integer value: ");
//read the value from the user
int myNumber = keyBoard.nextInt();
//Do the calculation
//increase the value of the variable by 10
int myAnswer = myNumber + 10;
//output the result.
System.out.println("Result: "+myAnswer);
//close Scanner
keyBoard.close();
}
}
Comments
Leave a comment