« All Events
7 PM Intro To Java – Alex
June 8, 2022 @ 7:00 pm - 8:00 pm
Today We Did:
- Reviewed the Magic8Ball Homework
- Started talking about Object-Oriented Programming
- Learned about how to use methods and the difference between void methods and return type methods
For Homework:
- Edit your Magic8Ball project to use an asList instead of having the 8 else ifs, so there should only be one if for quitting, and else should randomly print out one of the 8 items from the list.
- Create a new Java class <date>_MethodsHomework.java
- Create a new method convertFromFahrenheitToCelcius. It has one parameter int Fahrenheit. Inside the method, it will convert Fahrenheit parameter into Celcius by using this formula (F − 32) × 5/9 = C . You have to return the result. This is very similar to what we did in the class with addFourNumbers method.
- Along with that create another method that asks for your favorite song, and if the song is “Shape of You” then say that it is your favorite song, otherwise say that the song is alright.