AP Computer Science A - Unit 2: Using Objects
Vložit
- čas přidán 4. 08. 2024
- Study guide and exam review for Unit 2: Using Objects.
APCSA curriculum in Java
ap csa unit 2
➡️ Great AP CSA Exam Review Book: amzn.to/3RGN8ii ⬅️
🎧🚀 Fun Sci-Fi Audiobook For Educators: amzn.to/3TItymu 🪐🎧
Chapters
0:00 Introduction
0:20 Using Java Classes and Objects
5:47 Methods, Parameters, and Return Types
13:12 Escape Sequences ( \\ \" \'
)
16:05 String and String Methods
23:58 Math Class
26:55 Random Numbers With Math.random()
30:40 Scanner Class For Taking User Input
Also check out the College Board Advanced Placement AP Daily Live Review Sesson.
#Java #JavaTutorial #APComputerScienceA
➡ Great AP CSA Exam Review Book: amzn.to/3RGN8ii ⬅
🎧🚀 Fun Sci-Fi Audiobook For Educators: amzn.to/3TItymu 🪐🎧
Thank you so much for these videos! I couldn’t really find any other tutorials that explained in-depth enough to make you be able to understand the material proficiently but not too detailed to be confusing. Huge thanks!
Thanks for watching and commenting!
I learned so much in so little time. Thank you for making videos like these. I don't have to be searching a bunch of videos to understand each topic. Video is super helpful, Thank you! helped me a lot.
Great thanks so much for your help and support and guidance please make more videos like this awesome videos
This guy should go down in history as a legend
This video is really helpful, thank you so much!
Thanks for watching and commenting, Aadarsh!
TYSM
at 30:08 example 1, wouldn't there be a higher chance for Dorothy to be chosen compared to all the others? To get dorothy, you need 0, which would happen if math.random generated anything from 0 to 0.3, so there are 4 options for that. For glenda it would be 0.4-0.6, which is only 3, and for Toto it would also be 3, since it would be from 0.6-0.9
Excellent question. It won't be completely equal, but it will be extremely close. To get Dorothy (index 0) Math.random() would need to return between 0 and 0.3333333333333333, which is ALMOST 1/3.
There are ways to do better but at the end of the day Math.random() returns a pseudo-random number, not a true random number. Some pseudo-random number generators are better than others, and to really go down a rabbit hole, type in pseudo-random vs. true random into CZcams.
actually, I was thinking about this as well, but I find out that the three indexes are equally distributed, which each of the index would obtain a 33.3% chance. Just noticed that math.random generates not only 0.1, 0.2, 0.3, but to the thousandths as well. bc you included 0, and excluded 0.9-1. btw, I think you are trying to say 0 to 0.3, 0.3-0.6, 0.6-0.999999999
so helpful tysm
Thanks for the comment YoJacq. I'm glad it was helpful.
Mr. Barnum
30:20 wouldn’t this just make it so anything only equal to zero would be heads? What if the random generator generated 0.12 for example? Then the only possibility to make it heads would be 0 no? Making it harder to actually get heads and thus, not making it a 50/50 chance.
So instead of that, could I do if(coinFlip < 1), SOP(“Heads”) so it’s actually 50/50? Or am I thinking of this number generator wrong?
are scanner inputs tested on the ap csa exam?
No
16:34 - 23:58
W
My daughter is taking a high school CSA class learning JAVA 1.16 math riddle numbers. but she can't figure out how to do the equation. Do you have videos to help?
Hi Semia,
It sounds like that lesson may be part of a specific curriculum that I'm not familiar with.
If you have a link to that problem, I might be able to point you in the right direction.
Bill you are so helpful. Thank you soooooooo much!!!!
System.out.print(“Thank you!!!”);
Thanks for watching and commenting, Darth!