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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started