Question: Create a new project in BlueJ. Create two new classes in the project, with the following specifications: Class name: Part Fields : id (int) description

Create a new project in BlueJ. Create two new classes in the project, with the following specifications:

Class name: Part

Fields:

  • id (int)
  • description (String)
  • price (double)
  • onSale (boolean)

1 Constructor: takes parameters partId, partDescrip, and partPrice to initialize fields id, description, and price; sets onSale field to false.

Methods: Write get-methods (getters) for all four fields. The getters should be named getId, getDescription, getPrice, and isOnSale.

Class name: Runner

Fields:

  • bibId (int)
  • event (String)
  • age (int)

1 Constructor: takes parameters runnerBibId, raceEvent, and runnerRaceDayAge as parameters to initialize fields

Methods: Write get-methods (getters) for all three fields. The getters should be named getBibId, getEvent, and getAge.

Save the project as a jar file to submit.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!