American Young Coder (AYC)

AYC logo
Loading Events

« All Events

  • This event has passed.

6 PM – Intro To Java – Bill

March 28 @ 6:00 pm - 7:00 pm

Today We:
  1. Learned about how to create classes
Your HW:
  1. Create a new package called Mar_28_HW
  2. Create a Car class
    1. Attributes (all private):
      1. Brand (String)
      2. Model (String)
      3. Year (Int)
    2. Methods:
      1. Getters and Setters for the 3 attributes
      2. The Constructor with 3 parameters for the brand, model, and year
      3. drive
        1. void method
        2. 1 parameter miles
        3. will print out: “you drove the <year> <brand> <model> <miles parameter> miles”
      4. display
        1. will return the string in the format of “<Brand> <Model> – <Year>”
  3. Create a CarTester class
    1. this will have the main method that you will use to test the code
    2. Create 3 cars
      1. Ex: 2005 Honda Civic, 2024 Porsche 911, 2011 Chevy Camaro
    3. Display all 3 cars using the display method
    4. Drive all 3 cars 5 miles each

Details

Date:
March 28
Time:
6:00 pm - 7:00 pm
Verified by MonsterInsights