Java Program #34 - Make a Simple Calculator Using Switch Case in Java

  Рет қаралды 79,973

Programming For Beginners

Programming For Beginners

Күн бұрын

Пікірлер: 52
@programmingforbeginners7392
@programmingforbeginners7392 Жыл бұрын
Watch more such videos in below playlist: Java Tutorial: kzbin.info/aero/PLhyraTKIsw5_WemVMvshNm-0aC7zfISCO Java Programs: kzbin.info/aero/PLhyraTKIsw59nQJKvZTKmNK2aMxHwvLOa
@Hinoligy
@Hinoligy Жыл бұрын
This helped me understand switches more thx bro
@programmingforbeginners7392
@programmingforbeginners7392 Жыл бұрын
welcome. share with your friends!
@SHIVAMKUMARSHARMA-ps3gl
@SHIVAMKUMARSHARMA-ps3gl Жыл бұрын
Write a program for calculators in java which performs addition, subtraction, multiplication and division of any two numbers. Take user input using Scanner class and print the results of every calculation. do it
@NikhilVamsi8
@NikhilVamsi8 10 ай бұрын
Wahh.... Brilliant job... Nice explanation.. Keep it up 💯👏
@programmingforbeginners7392
@programmingforbeginners7392 10 ай бұрын
Thanks a lot 😊
@me_master_meme
@me_master_meme Жыл бұрын
Your explanation is very good keep going : )
@programmingforbeginners7392
@programmingforbeginners7392 Жыл бұрын
Thank you, I will
@khushisingh4584
@khushisingh4584 Жыл бұрын
Thanks for the video it helped me a lot ❤️
@programmingforbeginners7392
@programmingforbeginners7392 Жыл бұрын
Glad it helped!
@roll20nilaydasgupta41
@roll20nilaydasgupta41 2 ай бұрын
How we can do the arithmetic operation??? Eg - 1+2-5(3*4)
@SuperWaqas007
@SuperWaqas007 3 ай бұрын
so much thank full to you sir...
@programmingforbeginners7392
@programmingforbeginners7392 3 ай бұрын
Most welcome
@Simranrajpoot_ಠ_ಠ
@Simranrajpoot_ಠ_ಠ 24 күн бұрын
Is this the only method using switch case I mean what if we just don't want the user to give the operator or value and declare it by ourselves?????
@programmingforbeginners7392
@programmingforbeginners7392 23 күн бұрын
You can make the calculator using other algorithms as well.. there are multiple ways
@ilyosshoniyozov6012
@ilyosshoniyozov6012 Жыл бұрын
Bro you made a mistake which was in 4th operator. You have to put n2=0 System.out.println ("invalid"); Or other things words like that
@Got_viral
@Got_viral Жыл бұрын
Thanks bro
@programmingforbeginners7392
@programmingforbeginners7392 Жыл бұрын
Welcome
@meriemmansouri3441
@meriemmansouri3441 Жыл бұрын
Thank you so much 🙏
@programmingforbeginners7392
@programmingforbeginners7392 Жыл бұрын
You're welcome 😊
@showme13100
@showme13100 Жыл бұрын
Dont we need to return the value of result or is it restricted in switch statement?
@programmingforbeginners7392
@programmingforbeginners7392 Жыл бұрын
We can return the value of result since it is declared under main function.. we just needed to print result so it was printed within main, but you can return it as well if using another function for switch case
@showme13100
@showme13100 Жыл бұрын
@@programmingforbeginners7392 thank you
@furkan809
@furkan809 Жыл бұрын
thank you
@programmingforbeginners7392
@programmingforbeginners7392 Жыл бұрын
You're welcome
@RashmiRashmi-rw4ek
@RashmiRashmi-rw4ek 3 ай бұрын
the code is showing that the operator is defined first and then again why the declaration is again required
@RashmiRashmi-rw4ek
@RashmiRashmi-rw4ek 3 ай бұрын
where is the modulus operator??
@Jeremy-m8r
@Jeremy-m8r 11 ай бұрын
Can you tell me how to use multiple operators
@prachitawde6948
@prachitawde6948 5 ай бұрын
😅
@azharalibalouch3766
@azharalibalouch3766 Жыл бұрын
wow
@programmingforbeginners7392
@programmingforbeginners7392 Жыл бұрын
Thanks 👍
@Idealbruda
@Idealbruda 4 ай бұрын
Is it necessary to write result =0 , can't we just start from switch
@RashmiRashmi-rw4ek
@RashmiRashmi-rw4ek 3 ай бұрын
no
@SladeBuffet
@SladeBuffet Жыл бұрын
you should consider that you cannot divide by 0
@weewee3138
@weewee3138 Жыл бұрын
It’ll give a logical error
@huyle5011
@huyle5011 Жыл бұрын
How to make operator as + - × /
@programmingforbeginners7392
@programmingforbeginners7392 Жыл бұрын
you can ask the user to provide input as one of these 4 operators as a string, and based on the operator and other 2 numbers, the calculations can be done
@hasthapurammonuninni9591
@hasthapurammonuninni9591 Жыл бұрын
bro how to give continuous input without running programe again and again
@programmingforbeginners7392
@programmingforbeginners7392 Жыл бұрын
Put the code inside loop to continuously use the calculator
@tamilathalainimirtamila9120
@tamilathalainimirtamila9120 10 ай бұрын
​@@programmingforbeginners7392 Bro when I given exit option on the time wise program was get exit other wise prog still running wht a loop i use
@hrushikeswarareddy251
@hrushikeswarareddy251 11 ай бұрын
how can the program should keep on executing automatically after onetime completion plz let me know
@programmingforbeginners7392
@programmingforbeginners7392 11 ай бұрын
Put it in while(true) loop to run continuously
@selfsufficient1987
@selfsufficient1987 Жыл бұрын
If I choose division and entered two nos as 35 and 45 then it gives me result as 0 Please explain
@programmingforbeginners7392
@programmingforbeginners7392 Жыл бұрын
35/45 gives us result as 0.77 usually but in the Java code we are taking both these numbers as integers and that's why the result of division operation is also integer in this case - 0.77 is taken as 0 in the result.. Change the data type to double for both the inputs taken and you'll get the result as 0.77 Hope this helps 👍
@mann_mann
@mann_mann Жыл бұрын
@@programmingforbeginners7392 i have tried but still it is not working properly and it did not print the correct value.
@programmingforbeginners7392
@programmingforbeginners7392 Жыл бұрын
can you please provide your code?
@shuraimzaid6726
@shuraimzaid6726 Жыл бұрын
Double and float data types can be used in switch statements
@shuraimzaid6726
@shuraimzaid6726 Жыл бұрын
​@@programmingforbeginners7392not working
@kaiumalrafi1369
@kaiumalrafi1369 Жыл бұрын
thank you so much. it helps me a lot..
@programmingforbeginners7392
@programmingforbeginners7392 Жыл бұрын
Welcome. Subscribe and share with your friends 😀
Java Program #35 - Find Sum of Natural Numbers using Recursion in Java
6:43
Programming For Beginners
Рет қаралды 9 М.
Build this JS calculator in 15 minutes! 🖩
15:20
Bro Code
Рет қаралды 670 М.
Lazy days…
00:24
Anwar Jibawi
Рет қаралды 7 МЛН
I thought one thing and the truth is something else 😂
00:34
عائلة ابو رعد Abo Raad family
Рет қаралды 12 МЛН
Sigma Kid Mistake #funny #sigma
00:17
CRAZY GREAPA
Рет қаралды 9 МЛН
Java Programming Tutorial - 7 - Building a Basic Calculator
7:12
thenewboston
Рет қаралды 2 МЛН
How to make a Simple Calculator using AWT in Java
24:42
Code Void
Рет қаралды 39 М.
Java Program #17 - Sort an Array of Integers in ascending order
7:31
Programming For Beginners
Рет қаралды 76 М.
Beat Ronaldo, Win $1,000,000
22:45
MrBeast
Рет қаралды 29 МЛН
Program to Create Calculator using switch case in Java by Deepak
11:21
Smart Programming
Рет қаралды 167 М.
Learn JSON in 10 Minutes
12:00
Web Dev Simplified
Рет қаралды 3,2 МЛН
Learn Java in 15 Minutes (seriously)
19:50
ForrestKnight
Рет қаралды 129 М.
How To Make A Calculator Using HTML CSS And JavaScript
19:01
GreatStack
Рет қаралды 935 М.
Switch Case in Java #35
9:30
Alex Lee
Рет қаралды 207 М.
Lazy days…
00:24
Anwar Jibawi
Рет қаралды 7 МЛН