1. Congratulations! You're the proud CEO of a java-based car production company. You're just starting up your business,

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

1. Congratulations! You're the proud CEO of a java-based car production company. You're just starting up your business,

Post by answerhappygod »

1 Congratulations You Re The Proud Ceo Of A Java Based Car Production Company You Re Just Starting Up Your Business 1
1 Congratulations You Re The Proud Ceo Of A Java Based Car Production Company You Re Just Starting Up Your Business 1 (90.48 KiB) Viewed 20 times
1. Congratulations! You're the proud CEO of a java-based car production company. You're just starting up your business, however, so you have a huge collection of random hubcaps that you've found over the past few years that you want to use. You have a class called "CarChassis", which has one instance variable `private Tire[] tires' which is an array of Tires that should store FOUR tires. The Tire class has one instance variable, `private Hubcap hub'. Finally, the Hubcap class has one instance variable, `private String model'. Write three constructors; one for CarChassis, Tire, and Hubcap. The CarChassis constructor takes an Array of Strings (it will be of size 4), with each string representing a hubcap model (for example, ["rusty hubcap", "orange hubcap", "tinted hubcap", "golden hubcap"]). When creating your array of Tires within this constructor, each of the Tire objects should be passed one of the hubcaps from the Array of Strings. The Tire constructor will take a String 'model', representing the model of hubcap on that tire. The Hubcap constructor also takes a String 'model' and sets its instance variable 'model' to that parameter. Copy/Paste, then fill in the code for the following constructors: public CarChassis (String [] hubcaps) { } public Tire(String model) { } public Hubcap(String model) {
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply