Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

🎯 Objective

Your task is to create a Java class called Car and a corresponding driver program to interact with it.

...

  1. Prompts the user to enter the brand, model, year, and current mileage for a new car.

  2. Creates a new Car object using the parameterized constructor and the user's input.

  3. Prints out the car's brand, model, year, and current mileage .(format output and make sure you label the data)

  4. Prompts the user to enter a the number of miles to drive the car. Calls thedrive method with the user's input, then prints out the car's new mileage using an appropriate label.

This assignment will allow you to practice using classes, constructors, methods, and simple user interactions in Java. The Car class is a simple model of a real-world entity.

🚚  Deliverables

Upload the following files in a zip folder that you have created:

  1. Java files - EmployeeCar.java and your driver file

  2. Screenshot of the Console with the code executing

...