9 years ago (Jul 03, 2015) | 2,797 views |
How To Make A Simple Calculator in Java
Category: Java Programming, Programming Tags: java calculator, Java simple calculator by Shawon
Hello Guys.. This is my First Tutorial in New Trickbd. I am Starting my Tutorial With Java Programming.
If You Want To Start Java Programming Then At First You Need To Download Netbeans Or Eclipse IDE
Go To
From Here Download Netbeans. Download Java SE for Standard Edition Or If You Want To Work With All Platforms Download All
After Download Install Netbeans IDE
Now Go To File>>New Project>>Java>>Java Application
Now Give Your Project Name. I am Showing You a Simple Calculator. This is Very Beginning And It will Work in Java Console. It is Not A Graphical Software. Later I Will Show You Java Desktop And Mobile Software Making
So Project Name Calculator. Click Next. A White Window Will be Opned. Remove All Code And Paste This Code
import java.util.Scanner;
public class Calculator {
public static void main(String[] args) {
Scanner input=new Scanner(System.in);
double a,b;
System.out.println(“Enter 1st Number=”);
a=input.nextDouble();
System.out.println(“Enter 2nd Number=”);
b=input.nextDouble();
System.out.println(“Enter + For Add=”);
System.out.println(“Enter – For subtract=”);
System.out.println(“Enter * For multiplication=”);
System.out.println(“Enter / For divition=”);
char c;
System.out.println(“Enter Character=”);
c=input.next().charAt(0);
switch(c)
{
case ‘+’:
System.out.println(“Addition Is=”+(a+b));
break;
case ‘-‘:
System.out.println(“Subtraction Is=”+(a-b));
break;
case ‘*’:
System.out.println(“Multiplication Is=”+(a*b));
break;
case ‘/’:
System.out.println(“Divition Is=”+(a/b));
break;
default:
System.out.println(“Invalid Input”);
break;
}
}
}
Now Go to Run And Click Run File. In Below Output Console Your Program Will be Started To Run. Give Two Number. Then Give Operator And You Will Show Your Calculated Output.
No More Today. Happy Coding 🙂
31 responses to “How To Make A Simple Calculator in Java”
Leave a Reply
You must be logged in to post a comment.
Categories
- Android (24)
- Android Applications (15)
- Android Develop (6)
- Android Custom Rom (2)
- Android Root (6)
- Xposed (1)
- Android Games (1)
- Android Tips (7)
- Education (3)
- Examination Results (2)
- Facebook Tips (14)
- Featured (6)
- Free Internet Trick (13)
- Airtel Free Internet (2)
- BL Free Internet (2)
- Gp Free Internet (4)
- Robi Free Internet (2)
- Freelancing (2)
- Hacking (2)
- Hot (5)
- Java (2)
- Java Development (1)
- Mobile Tips (4)
- Operator News (43)
- Airtel (8)
- Banglalink (3)
- Grameenphone (25)
- Offer & Promotion (1)
- Robi (9)
- Teletalk (1)
- Other (8)
- Programming (6)
- Java Programming (6)
- Sponsored (1)
- Technology Update (1)
- TrickBD Updates (5)
- Web Development (13)
- Alexa Tips (1)
- Domain & Hosting (1)
- Seo (5)
- Wapka (3)
- wwordpress (2)
- Windows (4)
- Windows Games (1)
- Windows Tips (3)
Nice post bro.. But without advanced java programmer no one can get that
Agree! @Rana
Hlw rana bro make me tuner i will post dailly with your ruls.plz bro. :'(
osm
If You Know at least One Programming Language Like C Then It will be quite easy. @Rana
Nice for start
… [Trackback]
[…] There you will find 31092 more Infos: en.trickbd.com/make-simple-calculator-java/688 […]
… [Trackback]
[…] Read More here: en.trickbd.com/make-simple-calculator-java/688 […]
… [Trackback]
[…] Informations on that Topic: en.trickbd.com/make-simple-calculator-java/688 […]
… [Trackback]
[…] Read More here: en.trickbd.com/make-simple-calculator-java/688 […]
… [Trackback]
[…] Read More: en.trickbd.com/make-simple-calculator-java/688 […]
… [Trackback]
[…] Informations on that Topic: en.trickbd.com/make-simple-calculator-java/688 […]
… [Trackback]
[…] There you will find 25309 more Infos: en.trickbd.com/make-simple-calculator-java/688 […]
… [Trackback]
[…] Informations on that Topic: en.trickbd.com/make-simple-calculator-java/688 […]
… [Trackback]
[…] Read More: en.trickbd.com/make-simple-calculator-java/688 […]
… [Trackback]
[…] Informations on that Topic: en.trickbd.com/make-simple-calculator-java/688 […]
… [Trackback]
[…] Informations on that Topic: en.trickbd.com/make-simple-calculator-java/688 […]
… [Trackback]
[…] Informations on that Topic: en.trickbd.com/make-simple-calculator-java/688 […]
… [Trackback]
[…] Read More Infos here: en.trickbd.com/make-simple-calculator-java/688 […]
… [Trackback]
[…] Informations on that Topic: en.trickbd.com/make-simple-calculator-java/688 […]
… [Trackback]
[…] Read More: en.trickbd.com/make-simple-calculator-java/688 […]
… [Trackback]
[…] There you will find 96183 more Infos: en.trickbd.com/make-simple-calculator-java/688 […]