Create a class named vehicle. The class has the following members: 1. Private data elements: a. licenseNumber b. ownerName c. ownerlicenseNumber d. registrationNumber int 2. Public data members: int char 60 int a. A default constructor. b. A primary constructor with all the data elements passed as arguments. C. Method setVehicleData that accepts no parameters and returns no values. This method accepts input from the user for the private data elements.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter4: More Object Concepts
Section: Chapter Questions
Problem 11PE
icon
Related questions
Question

Using Java!!

Create a class named vehicle. The class has the following members:
1. Private data elements:
a. licenseNumber
b. ownerName
c. ownerlicenseNumber
d. registration Number int
2. Public data members:
int
char
int
60
a. A default constructor.
b. A primary constructor with all the data elements passed as arguments.
c. Method setVehicleData that accepts no parameters and returns no values. This method
accepts input from the user for the private data elements.
d.
Method printVehicleData that accepts no parameters and returns no values. This method
prints the private data elements.
e. Instantiate four object's named vehicleTest1, vehicleTest2, vehicleTest3 and vehicle Test4
of the class vehicle.
f.
Accept values for the object vehicleTest using the method setVehicle Data.
Print values from the object vehicleTest using the method printVehicleData.
Transcribed Image Text:Create a class named vehicle. The class has the following members: 1. Private data elements: a. licenseNumber b. ownerName c. ownerlicenseNumber d. registration Number int 2. Public data members: int char int 60 a. A default constructor. b. A primary constructor with all the data elements passed as arguments. c. Method setVehicleData that accepts no parameters and returns no values. This method accepts input from the user for the private data elements. d. Method printVehicleData that accepts no parameters and returns no values. This method prints the private data elements. e. Instantiate four object's named vehicleTest1, vehicleTest2, vehicleTest3 and vehicle Test4 of the class vehicle. f. Accept values for the object vehicleTest using the method setVehicle Data. Print values from the object vehicleTest using the method printVehicleData.
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Unreferenced Objects
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning