Skip to content

Commit b28a5e0

Browse files
author
salonigarje
authored
Updated
1 parent 75e8996 commit b28a5e0

1 file changed

Lines changed: 29 additions & 18 deletions

File tree

Calc.java

Lines changed: 29 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
// https://www.facebook.com/anushka.saine.735/posts/137136021429328
22
// subscribed by status gram
3-
import java.util.
4-
3+
import java.util.*;
54
//Simple calculator
65

76
public class calc
@@ -28,29 +27,41 @@ public static void main(String[] args)
2827
double multiplication = 3;
2928
double division = 4 ;
3029
double power = 5;
31-
if (somethin == addition) {
30+
if (somethin == addition)
31+
{
3232
c = a + b;
33-
System.out.println(a + " + " + b + " = " + c); }
34-
else if (somethin == subtraction) {
33+
System.out.println(a + " + " + b + " = " + c);
34+
}
35+
else if (somethin == subtraction)
36+
{
3537
c = a - b;
36-
System.out.println(a + " - " + b + " = " + c); }
37-
else if (somethin == multiplication) {
38+
System.out.println(a + " - " + b + " = " + c);
39+
}
40+
else if (somethin == multiplication)
41+
{
3842
c = a * b;
39-
System.out.println(a + " * " + b + " = " + c); }
40-
else if (somethin == division) {
43+
System.out.println(a + " * " + b + " = " + c);
44+
}
45+
else if (somethin == division)
46+
{
4147
c = a / b;
42-
System.out.println(a + " / " + b + " = " + c); }
43-
else if (somethin == power) {
44-
System.out.println("Enhance A or B?" +
45-
"\n1.A" +
46-
"\n2.B");
48+
System.out.println(a + " / " + b + " = " + c);
49+
}
50+
else if (somethin == power)
51+
{
52+
System.out.println("Enhance A or B?" +"\n1.A" +"\n2.B");
4753
double enhance = in.nextDouble();
4854
double first = 1;
4955
double second = 2;
50-
if (enhance == first) {
51-
System.out.println(Math.pow(a, 2)); }
52-
else if (enhance == second); {
53-
System.out.println(Math.pow(b, 2)); }
56+
if (enhance == first)
57+
{
58+
System.out.println(Math.pow(a, 2));
59+
60+
}
61+
else if (enhance == second);
62+
{
63+
System.out.println(Math.pow(b, 2));
64+
}
5465

5566
}
5667
}

0 commit comments

Comments
 (0)