import java.util.Scanner; public class Main { public static void main(String[] args) { double x; double y; double z; Scanner scanner = new Scanner(System.in); System.out.println("Enter side x: "); x = scanner.nextDouble(); System.out.println("Enter side y: "); y = scanner.nextDouble(); z = Math.sqrt((x*x)+(y*y)); System.out.println("The hypotenuse is : "+z); scanner.close(); } }
@Doscoorn2 жыл бұрын
e
@francoiszamora35522 жыл бұрын
Hh
@dapianoman202 жыл бұрын
import javax.swing.JOptionPane; public class Main { public static void main(String[] args) { double x; double y; double z; x = Double.parseDouble(JOptionPane.showInputDialog(null,"What is side x?")); y = Double.parseDouble(JOptionPane.showInputDialog(null,"What is side y?")); z = Math.sqrt((x*x)+(y*y)); JOptionPane.showMessageDialog(null,"Side z is "+z); } } I decided to try writing the same program by myself but using the GUI from the last lesson to see how well I understood all of the concepts taught so far. Worked well. Thanks Bro! :D
@felexsabu2562 Жыл бұрын
@Bro Code Hey bro in 4:13 you type x but dont precede it with String. Is it ok to write a variable without adding its class. I just want to understand the reason of where one should add class.
@andersburon1216 Жыл бұрын
i tried combining with the previous lesson to spice it up: import javax.swing.JOptionPane; public class Main { public static void main(String[] args) { double x = Double.parseDouble(JOptionPane.showInputDialog("Enter side x: ")); double y = Double.parseDouble(JOptionPane.showInputDialog("Enter side y: ")); double z; z = Math.sqrt((x*x)+(y*y)); JOptionPane.showMessageDialog(null, "The hypotenuse is: "+z); } }
@eshaanjames43192 жыл бұрын
First of all his videos are direct to point ... no bullshit Then his voice is so soothing Explains everything really smoothly Then lastly Better than paid courses... He values out time.. everthing is point to point Great work Bro Keep growing Love from India
@abdalle34833 жыл бұрын
Wow, this series is better than paid ones. thank you Boss a lot
@BroCodez3 жыл бұрын
thanks for watching Abdalle
@Golosovtalks2 жыл бұрын
I wasn't able to find anything useful in russian segment of youtube about java, so i made up my mind to look for something in english segment and i came across with you. i don't figure out almost 20-30 % of your speaking, buy you turned out more useful and informative than those guys) thanks great for your extremely hard work)
@momomomo-lt5fs2 жыл бұрын
I'm a total beginner, I'm a career shifter, and I need to learn java. Thanks for this series I hope to learn what I need for java from this and so far it's very easy to understand concepts
@sutofana Жыл бұрын
hey,how is your career shifting going?
@reflex37178 ай бұрын
@@sutofanahe fucked up
@perezkirvygian97252 ай бұрын
I'm 16 years old right now, and I just learned the fundamentals of coding from another video to understand some of the terms ahead of time. I can say that it really helps when you explain things directly to the point. I've made a basic calculator for addition, multiplication, etc. (although I don't know how to combine all of them yet) just based on the lessons you taught on GUI introduction, arithmetic expressions, and user input. I just wanted to thank you for making this video. It's really helpful, coming from a guy in 2024.
@omersond48913 жыл бұрын
i am not bored to watch and comment your videos. and smash the like button every time with a "detroit smash"
@BroCodez3 жыл бұрын
United States of Smash! 👊
@omersond48913 жыл бұрын
@@BroCodez awersome xD
@MrViutiful3 жыл бұрын
Thanks for the explanation. Very easy but very useful for a beginner like myself.
@BroCodez3 жыл бұрын
thanks for watching Vitor
@thenickolau55422 жыл бұрын
You can also replace z value with Math.hypot(x, y) method (Java16). Thx for the vids, doing full course, pretty awesome so far!
@ilanshlain88193 жыл бұрын
Hey bro! I used what I learned from your GUI video and made this program into a GUI! import javax.swing.JOptionPane; public class Main { public static void main(String[] args){ double x; double y; double z; x = Double.parseDouble(JOptionPane.showInputDialog("Enter in size for side x")); //This is for side x. y = Double.parseDouble(JOptionPane.showInputDialog("Enter in size for side y")); //This is for side y. z = Math.sqrt((x*x) + (y*y)); JOptionPane.showMessageDialog(null, "The hypotenuse for your triangle is " + z); //This is for the hypotenuse. } } Thanks so much bro for making programming so much more enjoyable!
@Daddy_D96 Жыл бұрын
Tried the same, thanks for the help.
@pavelkvasnicka6856 Жыл бұрын
This is the best Java tutorial for beginners, so you can learn Java and English in one hit. Please keep going! I vote for Java advance tutorial. Thanks a lot Bro
@yrtech-pk2lz2 ай бұрын
I am a junior beginner. Sir thank you for this I learn a lot.
@munawaraliaraiz87603 жыл бұрын
Best playlist for beginners...❤️ Love ur videos Bro
@bagyu3333 жыл бұрын
Or you can play with an other math method Math.pow: import javax.swing.JOptionPane; public class Main { public static void main(String[] args) { double a = Double.parseDouble(JOptionPane.showInputDialog("Enter side 'a': ")); double b = Double.parseDouble(JOptionPane.showInputDialog("Enter side 'b': ")); double c = Math.sqrt(Math.pow(a, 2) + Math.pow(b, 2)); JOptionPane.showMessageDialog(null, "The hypotenuse is: " + c); } }
@stefan54503 жыл бұрын
I've always wanted to be able to calculate the hypotenuse of a triangle. Thx.
@jayarm.serrano183910 ай бұрын
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); double p; double b; double h; System.out.println("Enter base: "); b = sc.nextDouble(); b = Math.pow(b, 2); System.out.println("Enter perpendicular: "); p = sc.nextDouble(); p = Math.pow(p, 2); h = b + p; h = Math.sqrt(h); System.out.println(h + "inches"); sc.close(); } } I paused the video and tried to solve the problem by myself and this what I've done. Different code but both giving the same results. Hoping that soon I can make a more efficient code like yours. BTW, I just started learning java and my dream is to be come a software dev 😅 ps: your video tutorials really helping me a lot. thankyou so much!
@IceBeam933 жыл бұрын
Thank you so much for these tutorials. Just to give you a hint why you cant get an answer of -10 as a root is because it is a negative number!
@jilllin97762 жыл бұрын
Thank you for making the series video for the beginner. That's really helpful.
@ChristianRodriguez-tm3jg4 ай бұрын
You are really good at programming
@jazbaliola73402 жыл бұрын
Bro you're so fun to watch you make learning fun! Thank you.
@danielbrachman10 ай бұрын
love your teaching style!
@JamaicaAmor-o1u Жыл бұрын
I really do appreciate your sample program very big help for me.... thank you sooooo much
@ari_james_dio9090 Жыл бұрын
Most math gifted programmer
@nerochan40942 жыл бұрын
this is after GUI class, I tried this while using GUI! 🤩 Thankyou very much BRO!
@honoredegg2 жыл бұрын
7th. So you can use numbers to instantiate them with the Math function (round, floor, ceil, sqrt, abs, min, max). Thank you, ma Bro Sensei!
@stanislavdimitrov1643 Жыл бұрын
I am starting to like your videos. Cheers:)
@parsamousavi77262 жыл бұрын
im subbed on 3 different accounts thats how good this channel is
@BroCodez2 жыл бұрын
Hero!
@rashedulislamsunny9218 Жыл бұрын
thanks for helping me for my final year project thank you bro!
@juliuspiloton9846 Жыл бұрын
Thank you! Simple and easy to understand
@saikrishnakarra54723 жыл бұрын
Bro you are the best indeed. Subscribed to the channel!!!
@cameronstout17285 ай бұрын
Wonderful as always!
@Olympheus Жыл бұрын
Thank You Bro. You are a life saver.
@JuliHoffman2 жыл бұрын
WOW!!! I wish I'd had this in school!!! You rock!!!!!!!!!!!!!!!!!!!!
@honoredegg2 жыл бұрын
You deserve more likes. Subscribed.
@wallstreetbets77412 жыл бұрын
I learnt again from you as always thanks Bro
@chitzuru34674 ай бұрын
I'm 3 years late to witness this masterpiece
@ranasaani Жыл бұрын
Thanks for sharing this.
@itlogskina3 жыл бұрын
Thank you
@Suraj-rv2dt Жыл бұрын
You are great 👍 I am from India 🇮🇳
@AliiaAbdieva Жыл бұрын
great job thanks
@muhammadmushfiqurrahman16532 жыл бұрын
Thanks bro for your useful tutorial.
@StandProudYouAreStrong Жыл бұрын
Thank you bro :*
@RahmatullahVahdatWithCod-pl2vh2 ай бұрын
wow wow brother thank You
@bartomiejsniadach57952 жыл бұрын
another easy one. Thank you
@Simis9992 жыл бұрын
Nice sides you picked bro
@deltakelp34682 жыл бұрын
I'm getting this "The method sqrt(double) in udefined for the type Math" Even if I use your code. I don't really understand what is the problem. Edit: So I used "java.lang.Math.sqrt" instead of just "Math.sqrt" and it works
@filthipina11 ай бұрын
thank you, you are an angel 😇
@bekturasanbekov1979 Жыл бұрын
Thx for video Bro!
@haymig8457 Жыл бұрын
Great guy 🙏🙏🙏
@duxxgd273311 ай бұрын
this is awesome dude
@HavocMusic17593 жыл бұрын
I made a cleaner version with GUI. package learning; import javax.swing.JOptionPane; public class Learning { public static void main(String[] args) { double x = Double.parseDouble(JOptionPane.showInputDialog("Enter Side X:")); double y = Double.parseDouble(JOptionPane.showInputDialog("Enter Side Y:")); System.out.println("printing answer"); double z = Math.sqrt((x*x)+(y*y)); JOptionPane.showMessageDialog(null, "The hypotenuse of this triangle is "+z); System.out.println("printed"); } } thank you because I wouldn't of done that without you!
@abhinavshesware9122 Жыл бұрын
Learned a lot from you compared to other paid courses. Thank you BIG BRO CODE..
@bananinator2502 Жыл бұрын
thx for the free tutorials
@rivalahmad99233 жыл бұрын
thanks bro
@ibrahimylmaz83782 жыл бұрын
you are amazing!
@hoanginh14372 ай бұрын
the abs one got me haha
@dy_IAN5 ай бұрын
You boss, you saved me.
@AmberShah7862 жыл бұрын
Thank you bro
@Horatius_232 жыл бұрын
thanks! :D
@grozageorge2887 Жыл бұрын
Thanks 😇
@beom8285 Жыл бұрын
The best!!
@explodingrubberducky7972 жыл бұрын
great channel. Wish there was an sql course or something.
@cesara97472 жыл бұрын
awesome!
@Ramkumar-uj9fo4 ай бұрын
Core java math Basic Arithmetic (operators) Relational and Logical Operators Bitwise Operators Math Class Functions (limited trigonometry) Sets (through collections framework) Optimization (Queue and Scheduler and Threads) Calculus (Streams) Combinatorics (List Vectors ArrayList) Abstract Algebra (HashMaps) Java people were struggling with matrices. --- It is max Tegmark (mathematical universe) or Stephen Wolfram (Ruliad)
@chainsaw_dogАй бұрын
Thanks
@trickysachin2 жыл бұрын
Nice 👍😊😊😊
@pratikkandalgaonkar48432 жыл бұрын
Thanks bro!!!!!
@sairos40572 жыл бұрын
ty bro
@PoorwayTraning Жыл бұрын
thanks
@javierpesaresi311 Жыл бұрын
Fantastic-oooou!
@rufatalizada40062 жыл бұрын
Thanks Bro!
@user-gj3uh8rs3e11 ай бұрын
awesome
@prabhjotsingh89083 жыл бұрын
Awesome.!
@yrtech-pk2lz2 ай бұрын
Sir ,is 1.)double y = -10.0 ; 2.) double y = -10 ; Sir 1 or two correct sir 2:29
@greeneggsandmushrooms98553 жыл бұрын
m + a + t + h = math
@shahnewazish Жыл бұрын
Great
@huuloc87192 жыл бұрын
Nice.
@EAGBADEHC Жыл бұрын
nice
@deltakelp34682 жыл бұрын
I'm getting this "The method sqrt(double) in udefined for the type Math" Even if I use your code. I don't really understand what is the problem.
@Giovanni-Rhonim7 ай бұрын
God Bless you Bro +4
@trypwyre90242 жыл бұрын
So we need to import math modules? because the functions like sqrt, abs, and max-min don't work, please advise!
@johnnymartin39112 жыл бұрын
You shouldn't need to import anything Math.something, is the M in Math capitalized?
@trypwyre90242 жыл бұрын
@@johnnymartin3911 no it was just a glitch in the whole application solved by reinstalling.
@yashkr41372 ай бұрын
Hello Mr. Bro, my IDE always gets errors even if I do not have any code written in it and it does not go away even if I delete my default package and remake it. The only way that I could remove that is by reinstalling the IDE and the JDE. Could you please tell me how to get away from that issue?
@sairos40572 жыл бұрын
I did in a slightly different way but got the same results . . . import java.util.Scanner; public class Main{ public static void main(String[] args) { //|**Creating a program that will find the Hypotenuse of a triangle**|\\ double a; double b; double hypotenuse; Scanner ScannerInput = new Scanner(System.in); //tag 01 System.out.print("Enter the side A: "); a = Double.parseDouble(ScannerInput.next()); System.out.print("Enter the side B: "); b = Double.parseDouble(ScannerInput.next()); hypotenuse = Math.sqrt((a*a)+(b*b)); System.out.print("The hypotenuse is: "+hypotenuse); ScannerInput.close(); } }
@lemonov30312 жыл бұрын
thank you gigachad
@sadoqatsaidova1993Ай бұрын
print("good")😃😃
@majdal-semaan5408 Жыл бұрын
2:28 you can't put a negative number under square root😕
@khamedmohammedtaha54232 жыл бұрын
If the input is an integer what do we do //x=next.double()
@mustafaismail98022 жыл бұрын
import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.print("Enter the value of x : "); double x = scanner.nextDouble(); System.out.print("Enter the value of y : "); double y = scanner.nextDouble(); double z = Math.sqrt(Math.pow(x,2)+Math.pow(y,2)); System.out.print("The Hypotenuse is : " + z); } }
@mojtabamoradi46893 жыл бұрын
great!!!!!!
@jadkhalil92632 жыл бұрын
just commenting for the youtube algorithm ;)
@mpathfinder3 жыл бұрын
Math.sqrt didn't work because you can't put a negative number in a root
@mpathfinder3 жыл бұрын
No flaming I'm so impressed of all you made here
@paia64472 жыл бұрын
But, sir it ain't work without import java.lang.Math; and thank you for your explanation
@anjolianjoli42292 жыл бұрын
One prayer for KZbin algorithm
@elefteris2 жыл бұрын
if i want to know the max numer in an array with input number and dimension, can i use somehow Math.max or i have to use For loop and do a temp variable to save every loop the max number?
@batnana47773 жыл бұрын
When I tried to do "math." it would only show class and main string? any1 know why edit: Is it because the public class is named Math?
@HavocMusic17593 жыл бұрын
probably
@RyanMcCollom3 жыл бұрын
Thank you I had the same problem and couldn't figure this out.
@Ribula19 ай бұрын
What do you mean by closijg the scanner? And what did you by by its nkt necessary?
@duxxgd273311 ай бұрын
i love you
@afshanbarlaskar93273 жыл бұрын
keep posting
@zapeeosheikh3 жыл бұрын
What's is the purpose of scanner . Close();
@linnko513 жыл бұрын
I need help what is scanner.close()? I don't get it what does it do ? someone help?