As the title, Says;
Command line calculator written in java in about 10 minutes by me, here we go;
May not be that useful, But I thought it'd be nice to share it so yep.
Command line calculator written in java in about 10 minutes by me, here we go;
![e22Q90M.png](/proxy.php?image=http%3A%2F%2Fi.imgur.com%2Fe22Q90M.png&hash=23d35958f514beb7813b59d15b58f039)
PHP:
import java.util.Scanner;
class apples {
public static void main(String args[])
{
int a,b;
String c;
Scanner choice = new Scanner(System.in);
System.out.println("Operation Choices [Addition,Subtraction,Multiplication,Division] :: ");
c = choice.nextLine();
System.out.println("Number 1 ::");
a = choice.nextInt();
System.out.println("Number 2 :: ");
b = choice.nextInt();
switch(c)
{
case "Addition":
int d = a+b;
System.out.printf("Addition of %d & %d is %d",a,b,d);
break;
case "Subtraction":
int x = a-b;
System.out.printf("Addition of %d & %d is %d",a,b,x);
break;
case "Multiplication":
int y = a*b;
System.out.printf("Addition of %d & %d is %d",a,b,y);
break;
case "Division":
int z = a/b;
System.out.printf("Addition of %d & %d is %d",a,b,z);
break;
default :
System.out.println(" Enter a proper choice faggot!");
break;
}
}
}
May not be that useful, But I thought it'd be nice to share it so yep.