Java Tutorial - This video will help you in understanding that how you can create a simple Calculator. We will develop/Create this calculator using the Java switch case. This Calculator will be able to preform operation like, +, -, *, / of any entered number from the user. WATCH NOW
#JAVA #Calculator #JavaTutorials
Code For The Calculator :
----------------------------------------
import java.util.Scanner;
public class Calculator{
public static void main (String[] args){
double num1;
double num2;
char operators;
double Result;
Scanner Input = new Scanner(System.in);
System.out.println("Enter the first no");
num1 = Input.nextDouble();
System.out.println("Enter the second no");
num2 = Input.nextDouble();
System.out.println("+, -, *, /");
System.out.println("Enter your preferred option");
operators = Input.next().charAt(0);
switch(operators){
case '+' :Result= num1+num2;
break;
case '-' :Result= num1-num2;
break;
case '*' :Result= num1*num2;
break;
case '/' :Result= num1/num2;
break;
default: System.out.println("Error! try again");
return;
}
System.out.println(num1 + "" + operators + "" + num2 + " = " + Result );
}
}
----------------------------------------
Agenda for the video:
Java Programming Tutorial - simple calculator
Basic Calculator using switch case in java,
Calculator using switch
Usage of Scanner Class
How to create objects in java
Use of switch case
►Check the Java playlist here:
• Java Tutorials
►Subscribe to this channel to get video updates. / arfisto
Follow Us On Social Media
►Facebook - / arfisto.youtube
►Instagram - / arfisto
►Twitter - / arfisto
For any question/query, you can always comment above or write us on arfisto6@gmail.com
In questa pagina del sito puoi guardare il video online Java Programming Tutorial - Building a Basic Calculator della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Arfisto ! 18 dicembre 2020, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 719 volte e gli è piaciuto 13 spettatori. Buona visione!