Calculator

Ads

 
 

Share on Google+Share on Google+

rohit gangurde
Calculator
2 Answer(s)      5 years and 7 months ago
Posted in : Java Beginners

need a simple java program to degin a CALCULATOR without using ADVANCED JAVA....

Ads
View Answers

October 17, 2011 at 11:14 AM




June 5, 2012 at 8:59 PM


import java.util.Scanner;

public class Cal {

public static void main(String[] args) {
    int a,b,i;
    System.out.println("Enter The Value Of A and B");
    Scanner sc=new Scanner(System.in);
    a=sc.nextInt();
    b=sc.nextInt();
    System.out.println("Enter 1 for Add");
    System.out.println("Enter 2 for Sub");
    System.out.println("Enter 3 for Multi");
    System.out.println("Enter 4 for Divide");
    i=sc.nextInt();

    switch (i)
    {
            case 1:
                System.out.println("Add is "+(a+b));  
                break;
            case 2:
                System.out.println("Sub is "+(a-b));
                break;
            case 3:
                System.out.println("Multi is "+(a*b));
                break;
            case 4:
                System.out.println("Divide is "+(a/b));
                break;
            default:
                System.out.println("Please Enter Correct Value");
                break;


}
}

}


Ads









Related Tutorials/Questions & Answers:
Calculator
Calculator  need a simple java program to degin a CALCULATOR without using ADVANCED JAVA....   Calculator in Java Swing
calculator midlet
calculator midlet  give me code calculator midlet in bluetooth application with j2me
Advertisements
Calculator class
Calculator class  I am a beginner in Eclipse. I have to do a program called calculator that adds numbers. This is my code so far: //Margaret //ICS... class Calculator extends JFrame implements ActionListener { JTextField text
simple calculator program in javascript
simple calculator program in javascript  strong textsimple calculator in javascript
thread program for calculator implementation
thread program for calculator implementation  Hi i'm prem i need calculator progrm in java that are implemented by Thread interface.....pls strong text
base calculator.. - Java Beginners
base calculator..  Help, i need some help about a base calculator.. i don't know how to start
Program for Calculator - Swing AWT
Program for Calculator  write a program for calculator?  Hi Friend, Please visit the following link: http://www.roseindia.net/java/example/java/swing/calculator-in-swing.shtml Hope that it will be helpful
calculator - Java Interview Questions
calculator  create calculator by java code  Hi Friend, Please visit the following link: http://www.roseindia.net/java/example/java/swing/calculator-in-swing.shtml Thanks
PHP Tax Calculator - PHP
PHP Tax Calculator  In my project i required a tax calculator that can calculate the property tax
simple calculator - Java Beginners
simple calculator  how can i create a simple calculator using java codes?  Hi Friend, Please visit the following link: http://www.roseindia.net/java/example/java/swing/calculator-in-swing.shtml Thanks
Calculator - JSP-Servlet
Calculator  Dear Deepak Sir, Calculator program is avilable in Jsp... calculator program in jsp function checkValue(){ var msg...; } Simple calculator program in jsp /> >
calculator - Java Server Faces Questions
calculator  Some ideas for the project of calculator
matrix calculator - Java Beginners
matrix calculator  hi..... can you help me in writing source code of matrix calculator in java... i know you are the best you can do it!!! show yourself
Scientific Calculator - Java Beginners
Scientific Calculator  Develop a scientific calculator using even-driven programming paradigm of Java.? Thanks in ADVANCE  Hi Friend, Please visit the following link: http://www.roseindia.net/tutorial/java
How to write calculator in J2ME program?
How to write calculator in J2ME program?  How to write calculator in J2ME program
calculator in java with stack
calculator in java with stack  i want calcultor with interface in java and in interface there is button called postfix ,,, when the user enter opertions and numbers first check if is vaild or not then convert to postfix
base calculator.. - Java Beginners
base calculator..  need some help!!! I cant install jcreator properly?? there's always an error (Error : Invalid path, "C:\Program Files\Java\jre1.6.0_01\bin\javac.exe" -classpath "C:\Program Files\Java\jdk1.6.0_01\bin" -d "C
Java Calculator Program
Java Calculator Program  Hi, so I need to make a program that "works like a calculator". I need to make two versions: 1) I'm given the Expression Class and need to implement the children classes, which are Number, Product, Sum
Design and Implement GPA Calculator
Calculator"); //frame.setLayout(new BorderLayout()); frame.setLayout...); headingLabel = new JLabel("Welcome To GPA Calculator
swimming pool calculator
", customers); jtabbedPane.addTab("Temp Calculator", tempCalc
Simple Java Calculator - Java Beginners
Calculator for 4 basic Math operations, Addition, Subtraction, Multiplication and Division. The calculator should simulate the look of handheld calculator containing.... Write proper code for making this calculator operational. Students
Java Calculator program - Java Beginners
Java Calculator program  import java.awt.*; import javax.swing.*; import java.awt.event.*; class Calculator implements ActionListener { int c,n...; Calculator() { f=new Frame("Calculator"); p=new Panel(); b1=new JButton("0
HTML Calculator
HTML Calculator In this example we will learn how to make HTML Calculator. We have used HTML language in this example. First off all we have created one...;. This calculator can be used to perform simple mathematical operations like
Swimming Pool Calculator - Java Beginners
Calculator is one that is very simple to use. As you can see, it is a user... PoolVolume() { mainFrame = new JFrame("Swimming Pool Volume Calculator
Writing Calculator Stateless Session Bean
Writing Calculator Stateless Session Bean... for our Calculator Session Bean:   /* * ...; <session > <description>EJB Calculator Session
Java Swing Scientific Calculator
Java Swing Scientific Calculator A Scientific Calculator is a very powerful and general purpose calculator. In addition to basic arithmetic functions... calculator using java swing. Here is the code: import java.awt.*; import
java loan calculator applet help
java loan calculator applet help  Hi, I could use some help correcting a code here. I need to write a Java applet program (together with its html test file) to calculate loan payments. The user will provide the interest rate
Swimming Pool Calculator - Java Beginners
()); mainFrame = new JFrame("Swimming Pool Volume Calculator"); calcButton = new
Swimming Pool Calculator - Java Beginners
Calculator", tempCalc ); jtabbedPane.addTab( "Customers", customers
Simple Calculator Application In Java Script
Simple Calculator Application In Java Script  ... Calculator The objective of this project is  learn how to write a simple calculator with the JavaScript programming language. You will learn how to write
Tutorials   
Java Spring Hibernate Struts Training What type of programming language is Java? How do beginners learn about Java? ClassNotFoundException HttpRequestInterceptor java.lang.noclassdeffounderror: org/apache/http/httprequest noclassdeffounderror: org/apache/http/client/methods/httpurirequest java.lang.NoClassDefFoundError: org/apache/http/client/HttpClient How do I resolve this Java Class not found exception? httpclient java.lang.NoClassDefFoundError Apache Commons ioutils maven dependency Read/Convert an inputStream to a String What is the meaning of Java Platform? Why Java is a platform independent language? What is the benefits of learning Core Java? Which technology should I learn after Java? What is array in java with example? How to Convert ArrayList to Array? How to substring in Java? How to format number in Java? What is instance variable in Java? How to download MySQL JDBC driver? What is Calendar class in Java? Which is the best Java tutorials for beginners? How to rename a file in Java? How to delete file in Java code? How to get day from date in Java using Calendar? How to get day of week in Java? How to calculate Date Difference in Java? How to compare date in Java? How to declare array in Java? How to calculate average of array in Java? What is Array in Java? write a java program to find the summation of all the integers entered on command line Sum of two numbers using command line arguments in Java How to create and use Array in Java? How to pass command line arguments in Java? How to create Applet Hello World? Appending String efficiently in Java How to append String in Java? How to list even numbers between 1 and 100? How to add BigDecimal in Java? What is Abstraction In Java? Which is best Beginners Java Tutorial? What is java.util package? Create list from array in Java Filter collection in Java 8 What is the best way to filter a Java Collection? Easy way to transform Collection to Array? How to convert Collection to Array in Java? What are Basic Java Language Elements? Advanced Java Tutorials in 2017

Ads

 
Advertisement null

Ads