before i watch here is how i think the code will look. Scanner scan = new Scanner(System.in); System.out.println("what is the number?"); Int nums = scan.nextInt; While(nums < = 100) { if(nums% 3 == 0 && nums %5 != 0) System.out.println("Fizz"); if(nums %5 == 0 && nums & 3 != 0) System.out.println("Buzz"); if(nums %5 == 0 && nums %3 ==0) System.out.println("FizzBuzz"); else System.out.println(nums); System.out.println("whats the next number?"); nums = scan.nextInt(); }
I've watched every video up to this point until I understand it. This is fawesome. I'm working on learning this so I can convert a bash script which reads data from my car into a java program which is cross platform.
I hope this tutorial gets into reading serial devices, or accessing computer devices.
Took me a while to find a solution, but when I did, I also discovered a new way to get only the decimals from a double.
I use a for loop with an initial variable of type double called a. I create a new String, then check if (int) a/3 equals a/3. If true, then I add Fizz. Then I check if (int) a/5 equals a/5. If true, I add Buzz. If my String is empty, I add (int) a. Then I println the String. ;)
Oh and the way to get the decimals from the double was to do myDouble - (int) myDouble.
Awesome tut, i''m learning so much. I took the base of fizzbuzz script to output numbers 1 - 100 printing each number & to the side telling whether its even or odd.
I took a semester learning MatLAB, (similar to C+ i think ?) Downloaded Eclipse, tried to use their tutorials, and their program is a different version then their help files i think. I came across your videos, and ran through them in a very short time and you got me up to speed. thank you... really good job on these. love this Fizz Buzz Test too.
I'm glad they helped. I've only used Eclipse through JBuilder at school (I'm pretty sure JBuilder is based off of Eclipse). But I'm not nearly experienced enough to make use of all the tools that Eclipse offers and I find they usually just get in the way so I use JEdit or Notepad most often.
Thanks! I did it in a few minutes. However, I only used 2 variables and created a for loop and used a switch inside of it.
calandrariley 7 months ago
SWEET!! I was actually able to create my own way of doing FizzBuzz! THANK YOU!
Wouldn't have been able to do it without you!
TheYetiNinja 8 months ago
This has been flagged as spam show
stickmenarekool 9 months ago
I've watched every video up to this point until I understand it. This is fawesome. I'm working on learning this so I can convert a bash script which reads data from my car into a java program which is cross platform.
I hope this tutorial gets into reading serial devices, or accessing computer devices.
outleradam 1 year ago
This has been flagged as spam show
outleradam 1 year ago
Took me a while to find a solution, but when I did, I also discovered a new way to get only the decimals from a double.
I use a for loop with an initial variable of type double called a. I create a new String, then check if (int) a/3 equals a/3. If true, then I add Fizz. Then I check if (int) a/5 equals a/5. If true, I add Buzz. If my String is empty, I add (int) a. Then I println the String. ;)
Oh and the way to get the decimals from the double was to do myDouble - (int) myDouble.
5/5
SweedRaver 2 years ago
Awesome tut, i''m learning so much. I took the base of fizzbuzz script to output numbers 1 - 100 printing each number & to the side telling whether its even or odd.
KevinRay2010 2 years ago
haha i did it the longest way possible
i made a crapload of or statements with an if else
but hell it worked
skatercdub16 3 years ago
That's good!
If you get the same output, you're not wrong but right.
Less code is more efficient, that's all
warlord90210 3 years ago
I took a semester learning MatLAB, (similar to C+ i think ?) Downloaded Eclipse, tried to use their tutorials, and their program is a different version then their help files i think. I came across your videos, and ran through them in a very short time and you got me up to speed. thank you... really good job on these. love this Fizz Buzz Test too.
Do you ever use eclipse?
Thank you again.
kSavvy 3 years ago
I'm glad they helped. I've only used Eclipse through JBuilder at school (I'm pretty sure JBuilder is based off of Eclipse). But I'm not nearly experienced enough to make use of all the tools that Eclipse offers and I find they usually just get in the way so I use JEdit or Notepad most often.
TruthBeautyGoodness 3 years ago