package algorithmsample4;
import java.util.Scanner;
/**
*
* @author Nurhak
*/
public class AlgorithmSample4 {
public static void main(String[] args) {
double result = 0;
double number1 = 0;
double number2 = 0;
String number = "";
try {
Scanner scan = new Scanner(System.in);
System.out.println("Please enter the first number.");
number = scan.nextLine();
number1 = Double.parseDouble(number);
System.out.println("Please enter the second number.");
number = scan.nextLine();
number2 = Double.parseDouble(number);
result = number1 / number2;
System.out.println("When we divide first number to second one, the result is: " + result);
} catch (Exception e) {
}
}
}
Comments
Post a Comment