About 40,500 results
Open links in new tab
  1. Basic calculator in Java - Stack Overflow

    I'm trying to create a basic calculator in Java. I'm quite new to programming so I'm trying to get used to it. import java.util.Scanner; import javax.swing.JOptionPane; public class javaCalculat...

  2. Simple calculator program in Java - Stack Overflow

    Feb 4, 2016 · I am a newbie coder in Java and I am trying to make this calculator in java where a user can enter two numbers and select the operation to be done on those numbers. However when the code comes to selecting the operator it skips the user input and the if statement and directly implements the else statement.

  3. Trying to create a calculator in Java - Stack Overflow

    Oct 6, 2015 · I am trying to create a calculator in Java. here is all my code: import java.util.Scanner; public class Calculator { public static void main (String[] args) throws java.lang.Exception{ ...

  4. Execution of do while loop in the Java Calculator program

    Jul 4, 2018 · In my Java Program, I have used a Boolean variable 'decision' which should execute the actual calculator code in the 'do loop code block' only when the variable is true, but the do while loop is executed anyways even when the decision variable is false. I am using Eclipse IDE for Java and JDK 10 (both are recent versions).

  5. Java calculator with multiple operations - Stack Overflow

    package org.sanjaya.impl; import java.math.BigDecimal; import org.sanjaya.Command; public class ArithmaticCalculatorCommand implements Command { private char operator; private BigDecimal leftOperand; private BigDecimal rightOperand; private Calculator calculator; public ArithmaticCalculatorCommand( char operator, BigDecimal leftOperand ...

  6. simple Java calculator - while loop until answer is 0

    Sep 25, 2014 · Really new to java and having some trouble with this assignment. The assignment was to: Write a simple calculator program that prints a welcome message, accepts a simple arithmetic expression from the user, and performs the requested operation. Your program should repeat this until both operands are 0 and then exit.

  7. Basic Java calculator using functions (beginner) - Stack Overflow

    May 7, 2017 · Hey guys i'm a beginner at java still learning. I have a question about functions. So I am creating just for fun a basic calculator package calculator; import java.util.Scanner; public class Calc...

  8. Java: Calculating Employee's Wage - Stack Overflow

    Aug 29, 2017 · The WageCalcu.java. ... create a salary/bonus calculator. 0. Nearly there, just need a little push in the ...

  9. java - Multiple class calculator - Stack Overflow

    Apr 30, 2015 · To create the constructor, (which will allow you to set the variables in the class and use them): public OperationClass(int fnum, int snum){ this.fnum = fnum; this.snum = snum; } Then you call it when instantiating the object (again, after the numbers have been inputted) using:

  10. java - How to get calculator program to add, subtract, multiply, …

    Jan 25, 2021 · **Here's an example output of my current calculator program followed by an example of the I output of my desired calculator program. current calculator output: 8.0 + 2.0 = 10.0. what i'm looking for calculator program to do: 8.0 - 4.0 * 10.0 = 40.0. Note: I am actively working for a solution myself when I have time to do so. If you dont feel ...

Refresh