-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathFunctions.java
39 lines (28 loc) · 1 KB
/
Functions.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import java.util.Scanner;
public class Functions {
// public static void isOne() {
// Scanner scanner = new Scanner(System.in);
// System.out.println("Enter a number: ");
// int number = scanner.nextInt();
// while (number != 1) {
// System.out.println("It is not 1");
// number = scanner.nextInt();
// }
// System.out.println("It is 1");
// scanner.close();
// }
public static double operateNumbers(int a, int b) {
double result = Math.pow(a, b) + Math.exp(a);
return result;
}
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
System.out.println("Enter a: ");
int a = scanner.nextInt();
System.out.println("Enter b: ");
int b = scanner.nextInt();
double r = operateNumbers(a, b);
System.out.println("The result of operation is: " + r);
scanner.close();
}
}