Select Page

Author: Dimas Raka Dewanggana

How to Make a Simple Calculator Using Java (Dimas Raka Dewanggana – 2103181011)

This video is about a procedure how to make a simple calculator that only has operator “+” (plus), “-” (minus), “*” (multiple), and “/” (divide) using Java language. The steps are explained below : 1. Open the text editor that you want to use to type the codes (I use Sublime Text 3) 2. Make a new file (just use CTRL + N) ====================Code==================== 3. Import java.util.Scanner 4. Type the name of the class (in this video is Calculator) 5. Type the main method 6. Declare the scanner that used for user’s input 7. Print “Enter two numbers : ” 8. Declare two variables that contains the numbers that user’s inputted as first and second (the data type is double) 9. Print “Enter an operator” 10. Declare a variable that contains the operator that user’s inputted as operator (the data type is char) 11. Declare a variable that contains the result from the operation 12. Use switch with the operator variable as the condition to select the operation from the operator that user’s inputted. Inside the switch there are many case from operator that user’s inputted. For the case 1, if the user input “+” the result is first + second. For the case 2, if the user input “-” the result is first – second. And so on. And the last for default, if the user’s input is...

Read More

Programming Languageā€™s Popularity Graphic in 2018

  Stack Overflow, a popular website that developers use to share their skills, usually does a yearly survey to get useful statistics from the developer community. In January 2018, the website surveyed more than 100,000 developers and revealed some interesting statistics. The chart shows the programming languages according to their popularity from the most popular to the least popularity. For the most popular is JavaScript language with 69.8% and the least is Go...

Read More

Pin It on Pinterest