Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New productivity code under 100 Lines of Code #42

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
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
Binary file added Calculator/Calculate.class
Binary file not shown.
35 changes: 35 additions & 0 deletions Calculator/Calculator.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import java.util.*;
class Calculate{
public static void main(String args[]){
Scanner x=new Scanner(System.in);
int i=1;
do{
System.out.println("Enter integer number 1");
int n1=x.nextInt();
System.out.println("Enter integer number 2");
int n2=x.nextInt();
System.out.println("Enter your choice 1. Addition 2. Subtraction 3.Multiplication 4.Divison");
int c=x.nextInt();
switch(c)
{
case 1: System.out.println(n1+n2);
break;

case 2: System.out.println(n1-n2);
break;

case 3: System.out.println(n1*n2);
break;

case 4: System.out.println(n1/n2);
break;

default: System.out.println("Invalid choice");
break;
}
System.out.print("Enter 1 to do another calculation ");
i=x.nextInt();
}while(i==1);

}
}
6 changes: 6 additions & 0 deletions Calculator/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Calculator performs basic calucations on Integers

<br>
<b>How to use?</b>
<br>
Open a terminal and write this command: java Calculate