Java Programming Tutorial - Building a Basic Calculator

Publicado el: 18 diciembre 2020
en el canal de: Arfisto !
719
13

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


En esta página del sitio puede ver el video en línea Java Programming Tutorial - Building a Basic Calculator de Duración hora minuto segunda en buena calidad , que subió el usuario Arfisto ! 18 diciembre 2020, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 719 veces y le gustó 13 a los espectadores. Disfruta viendo!