Post: Java Customizable Calculator (Open Source)
08-12-2015, 04:36 PM #1
HeroWin
Java Developer
(adsbygoogle = window.adsbygoogle || []).push({}); Today i made a basic calculator that allows to input numbers and java will output the rest depending on what kind of math you want java to perform.....

this is for people who are familiar with java and know how to execute this code...

In this code i simply added a '+' do give a basic idea of what it can do...

CODE:

    
package javaapplication5;
import java.util.Scanner;

/**
*
* @author HeroWin
*/
public class JavaApplication5 {
private static double answer;

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
Scanner b = new Scanner(System.in);
double fnum, snum, awnser;
System.out.println("Enter Your First #: ");
fnum = b.nextDouble();

System.out.println("Enter Your Second #: ");
snum = b.nextDouble();
answer = fnum + snum;
System.out.println(answer);


}

}

Copyright © 2024, NextGenUpdate.
All Rights Reserved.

Gray NextGenUpdate Logo