
- This event has passed.
3 PM – Intro To Java – Gamas
January 8, 2022 @ 3:00 pm - 4:00 pm
Today We Do
- We finished reviewing Guess A Number between 0 to 100 game.
- We started explaining about methods.
Homework
- If you are done with “tellMeYourAge” method, please try to finish it as part of the homework.
- Create a java file Jan8_MethodHomework.java. Inside this file, create a method favoriteSport(String sport). If the sport parameter is “Volleyball” (non-casesensitive) print to the shell “Volleyball is a my favorite sport “. Otherwise print to the shell “<sport> is not my favorite sport”. Call the method from main.
- Create another method, this time method with return value: convertFromFahrenheitToCelcius(int fahrenheit).
- it has one parameter: fahrenheit the formula to convert from fahrenheit to celcius is Celcius = (fahrenheit – 32) * 5/9 .
- So what you have to do is subtract 32 from the parameter fahrenheit and then multiple with 5 and divide by 9.
- return the calculation.
- The method needs to return a double data type.
- Call the method from main.
- If you have question, please feel free to email me to gamas@ayclogic.com