American Young Coder (AYC)

AYC logo
Loading Events

« All Events

  • This event has passed.

5 PM – Intro To Java – Alex Lee

March 10, 2023 @ 5:00 pm - 6:00 pm

Today We Did:
  1. We went over the Magic8Ball homework
  2. Also, learned about methods and how object-oriented programming works.
For Homework:
  1. Convert your Magic8Ball homework into a much shorter version of it:
    1. Put all of the different answer options into one list.
    2. Then by using a random number index, choose one of the options and print it out.
    3. The program should still ask “Enter yes or no question” and when the user inputs quit, the program should end.
  2. Create a new Java class <date>_MethodsHomework.java
  3. 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.
  4. Ask the user: “What temperature would you like to convert: ” and put the user’s input into the method.
  5. Print out “The temperature was converted from Fahrenheit: ‘fahrenheitNumber’ into Celsius: ‘celsiusNumber’

Details

Date:
March 10, 2023
Time:
5:00 pm - 6:00 pm
Event Categories:
,
Verified by MonsterInsights