« All Events
6 PM – Intro To Java
May 25, 2021 @ 6:00 pm - 7:00 pm
- We learned about methods in Java by converting Magic8Ball game into using methods:
- Method without return value
- Method with return value.
- We started May25_TellMeYourAgeMethodsHomework.java
- Homework:
- Inside May25_TellMeYourAgeMethodsHomework.java do the following
- Create run method similar to what we did in May25_Magic8BallUsingMethod.java
- Add a forever loop (while true) loop so this program will run forever until user enter “quit”.
- Create a method getUserAge() and move logic from run() that ask user for their age. This method needs to return a String which is the age that the user enters.
- Call getUserAge() method from the run() method and whatever the return value, check if it is equals to “quit” break from the loop.