Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .idea/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/Very-Simple-Java-Calculator.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 8 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions .idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added SimpleCalculator/src/SimpleCalculator.class
Binary file not shown.
21 changes: 17 additions & 4 deletions SimpleCalculator/src/SimpleCalculator.java
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ public void showMenu() {
System.out.println("2.Substraction");
System.out.println("3.Multiplication");
System.out.println("4.Division");
System.out.println("5.factorial");


}

Expand All @@ -22,7 +24,7 @@ public double division() {
double a, b;
System.out.println("Enter first value");
a = scan.nextDouble();
System.out.println("Enter first value");
System.out.println("Enter second value");
b = scan.nextDouble();
double val = a / b;

Expand All @@ -34,7 +36,7 @@ public double mutliplication() {
double a, b;
System.out.println("Enter first value");
a = scan.nextDouble();
System.out.println("Enter first value");
System.out.println("Enter second value");
b = scan.nextDouble();
double val = a * b;

Expand All @@ -46,7 +48,7 @@ public double substraction() {
double a, b;
System.out.println("Enter first value");
a = scan.nextDouble();
System.out.println("Enter first value");
System.out.println("Enter second value");
b = scan.nextDouble();
double val = a - b;

Expand All @@ -58,7 +60,7 @@ public double addition() {
double a, b;
System.out.println("Enter first value");
a = scan.nextDouble();
System.out.println("Enter first value");
System.out.println("Enter second value");
b = scan.nextDouble();
double val = a + b;

Expand Down Expand Up @@ -91,6 +93,17 @@ public static void main(String[] args) {
score = calc.division();
System.out.println(score);
break;
case 5:{
System.out.println("enter the number");
int num1 = scan.nextInt();
int a = 1;
for(int i = 1; i <= num1; i++){
a = a*i;
}
System.out.println("the factorial is" + " " + a);
break;
}

default:
System.out.println("Wrong choice");
break;
Expand Down