Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Plzzzzzzzzz do fast Let's assume that you have a Car class and some classes of their parts. As you know, you need engine, window, door

Plzzzzzzzzz do fast

image text in transcribed

Let's assume that you have a Car class and some classes of their parts. As you know, you need engine, window, door and tires for every car. For now, these parts are enough for the aim to design a car. On the other hand, you need to create some functions for these each component of a car. Now, you can design a car and its some functionalities with following these steps: Every car needs an engine. You can start from here. Firstly, create a class named Engine which has two methods (empty methods - do not need to create parameters for all of these methods for now in this question, such as start and stop to start and stop the engine. Secondly, create a class named Window which has two methods named pulldown and pullUp to pull down and up the windows on the doors. + Thirdly, create a class named Door which has its one property named window created from the Window class and two methods named open and close to open and close the doors of this car. Fourthly, create a class named Tires which has one method named pumpAir that has one parameter (argument) in integer type (Int) named pressure. Fifthly, create a class named Car which has four properties (like a constructor) named carEngine created from the Engine class, named rightDoor and leftDoor created from the Door class, named tires in array type (Array) having four Tires objects. Finally, create one object named myCar derived from the Car class in the main() method and test and try all of these properties and their relative methods using dot notation with this created myCar object

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions

Question

internationalization of business?

Answered: 1 week ago

Question

What is the most important part of any HCM Project Map and why?

Answered: 1 week ago