Question: Create a Motorcycle class with data fields for manufacturer, price and engine size ( in cubic centimeters, such as 7 5 0 ) ; include
Create a Motorcycle class with data fields for manufacturer, price and engine size in cubic centimeters, such as ; include get and set methods for all fields. Create a constructor that accepts values for all fields and assigns them appropriately; you do not need a "default" constructor. Save this file as Motorcycle.java.
In a separate file called TestMotorcycle.java, create a main method that prompts the user to input the information for two motorcycles they are comparing. Create two objects with that data, passing values in with the constructor. Finally, use the "get" methods to output all information about the two motorcycles.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
