-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpowsum.java
32 lines (29 loc) · 1.71 KB
/
powsum.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
import java.util.InputMismatchException;
import java.util.Scanner;
public class powsum {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
String reason = "the User Didn't type a valid int";
double num1;
int num2;
boolean baduser = true;
while (baduser) {
try {
System.out.println("Please enter the number you want to compute to the pow of 2");
System.out.print(">>");
num1 = input.nextInt();
System.out.println("Second number you want to add to the " + num1 +"pow2 + number ");
System.out.print(">>");
num2 = input.nextInt();
input.close();
//fcking stop Charlie !!!!!
baduserexample.IfTheUserhasSucessfullytypedTheFirstNumberAndTheSecondNumberThenThisWillBeCallToDisplayTheResultAndExitsTheprogram(baduserexample.ThePowerOfTheNumberThatTheUserInsertedToSolveHisOrHerProblemPlusTheNumberTheUserTypedtoSolveThePow2AndtheSecondNumber(baduserexample.ThePowerOfTheNumberThatTheUserInsertedToSolveHisOrHerProblem(num1), baduserexample.TheSecondNumberTypedByTheUserToAddthePwerOfthenumberThattheUserInsertedToSolveHisOrHerproblem(num2)), baduserexample.TheFirstNumbertypedByTheUserToSolveHisOrherProblem(num1), baduserexample.TheSecondNumberTypedByTheUserToAddthePwerOfthenumberThattheUserInsertedToSolveHisOrHerproblem(num2));
baduser = false;
} catch (InputMismatchException exception) {
//bro stop!
input.close();
baduserexample.ShowTheErrorMessageWhenTheUserIsBadAndNotFollowingTheinstructions(reason);
}
}
}
}