import java.util.Scanner;
public class LabExer1 {
public static void main(String[] args) throws Exception {
Scanner scanner = new Scanner(System.in);
System.out.println("Enter two numbers.");
System.out.print("Fist number: ");
double x = scanner.nextDouble();
System.out.print("Second number: ");
double y = scanner.nextDouble();
plusFive(x, y);
timesTwo(x, y);
showSquared(x, y);
computePercentage(x, y);
}
public static void plusFive(double x, double y) {
System.out.println(x+5+" and "+y+5);
}
public static void timesTwo(double x, double y) {
System.out.println(x*2+" and "+y*2);
}
public static void showSquared(double x, double y) {
System.out.println(x*x+" and "+y*y);
}
public static void computePercentage(double x, double y) {
double persint = (x/y)*100;
System.out.println(x+" is "+persint+" percent of "+y);
}
}3 views