answersLogoWhite

0


Best Answer

import java.io.*;

import java.util.*;

public class Calculator

{

public static void main(String args[])

{

System.out.println("Make your arithmetic selection from the choices below:\n");

System.out.println(" 1. Addition");

System.out.println(" 2. Subtraction");

System.out.println(" 3. Multiplication");

System.out.println(" 4. Division\n");

System.out.print(" Your choice? ");

Scanner kbReader = new Scanner(System.in);

int choice = kbReader.nextInt();

if((choice<=4) && (choice>0))

{

System.out.print("\nEnter first operand. ");

double op1 = kbReader.nextDouble();

System.out.print("\nEnter second operand.");

double op2 = kbReader.nextDouble();

System.out.println("");

switch (choice)

{

case 1: //addition

System.out.println(op1 + " plus " + op2 + " = " + (op1 + op2) );

break;

case 2: //subtraction

System.out.println(op1 + " minus " + op2 + " = " + (op1 - op2) );

break;

case 3: //multiplication

System.out.println(op1 + " times " + op2 + " = " + (op1 * op2) );

break;

case 4: //division

System.out.println(op1 + " divided by " + op2 + " = " + (op1 / op2) );

}

}

else

{

System.out.println("Please enter a 1, 2, 3, or 4.");

}

}

}

Read more: How_do_you_make_calculator_program_in_java

User Avatar

Wiki User

11y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you make a scientific calculator program in java?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Who make Java Program?

Many people make Java programs, but if you mean who invented the Java programming language it was James Gosling of Sun Microsystems.


What do a java developer do?

A Java developer helps create a program which can understand any form of computer language. A Java developer tries to make a program that can understand the computer language that is on any computer platform.


How do people make minecraft mods?

They program them using code and Java.


How do you make a RuneScape calculator?

First of all, you need some experience in computer programming - for example, Java or Flash.


How can you make java program to solve finite automata?

A person can make a Java program solve Finite Automata by creating a tool with Discrete. This should be done overt a network, so that all employees have access to the programming.


Is there a Java program for finding the zodiac sign?

I could make one, but "a program of zodiac signs" tells me little.


What do you get when you compile a java program?

The java interpreter or JVM (Java Virtual Machine) is not able to execute the java source code for a program. The java source code first needs to be compiled into bytecode that can be processed by JVM. Producing bytecode make the program platform independent as each platform has its own JVM. It is also possible to directly write bytecode, bypassing the need to compile, but that would be tedious job and also not good for security purpose as the compiler checks for various errors in a program.


What is the function value of sin 510?

You can calculate that with any scientific calculator, including the scientific calculator that comes with Windows, so there is really no need to ask such questions here. Just make sure that the calculator is in degrees, or in radians, depending on what the "510" represents.


How do you run java program in ubuntu OS?

Download the JRE (java runtime environment) from Sun's website. make sure you get a version that will run on your os.


How do you make an antivirus program using Java?

A running java program only has access to the memory allocated to it by the Java Runtime Environment. Java by design does not allow access to absolute memory locations which is required to scan for memory resident viruses. A Java-based anti-virus program can still read a virus-signature file and use it to scan for those patterns in files to identify possible infected files.


How do you write a java program to make a periodic table?

See the related links section for a link to a JAR file containing this program.


In relation to Java what is a thread?

A Java Thread is a thread of execution in a Java Program. A Java Virtual Machine can have a single application running multiple threads, which is known as concurrency. Threads are what make the program run. Each thread has a different priority, and when the machine queue fills up, the threads are executed in the order of their priority.