Database System Concepts
Database System Concepts
7th Edition
ISBN: 9780078022159
Author: Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher: McGraw-Hill Education
expand_more
expand_more
format_list_bulleted
Bartleby Related Questions Icon
Related questions
Question
Transcribed Image Text:●くろまる
• Compile the Automobile.java class and correct any errors.
Create another file named TestAutomobile.java that contains the main method. Create several
Automobile objects and test that your constructor and methods work as described.
●くろまる
Create a UML diagram of the Automobile class.
Create the Automobile.java class. It should have the instance variables, constructor(s) and
methods located below.
Automobile Instance variables
Reminder: + indicates public, - indicates private
- make (String): The automobile make (Ford, Acura, etc).
- model (String): The automobile model (Escapade, ZDX, etc).
- power (boolean): Holds the value true if the power is on and false if the power is off. The
default value is false.
.
- gear (char): Holds the value of the gear that the automobile is in. The default value is P
(Park). Other values include D (Drive), and R (Reverse).
Automobile constructors
• One constructor that takes two parameters and sets the make and model instance variables.
.
- volume (int): Holds a value representing the loudness (0 being no sound). The default value
is 6.
Automobile methods.
+ getMake: Returns the value stored in the make instance variable.
+ getModel: Returns the value stored in the model instance variable.
+ getGear: Returns the value stored in the gear instance variable.
+ getVolume: Returns the value stored in the volume instance variable.
+ getPower: Returns the value stored in the power instance variable.
1
●くろまる
• + setGear: Sets the value stored in the gear instance variable.
+ increaseVolume: Increases the value stored in the volume instance variable by 2. The max
value is 30.
+ decreaseVolume: Decreases the value stored in the volume instance variable by 2. The
minimum value is 0.
+ setPower: Toggles the value stored in the power variable to true if the value is currently false
and changes it to false if the value is currently true.
Expert Solution
Check MarkThis question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
bartleby
Step by stepSolved in 4 steps with 4 images
Knowledge Booster
Background pattern image
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
- Working With Java Classes Define a Java class as described below. All variables should be declared as private and all methods as public. Save the class definition in a file with an appropriate filename. Class Name: Family Instance Variables: numDependents - int (Fields) annualIncome - double Instance Methods: A constructor that accepts no arguments and sets the number of dependents field to 1 and the annual income field to zero. rate). A constructor that accepts 1 argument, an annual income amount and sets the number of dependents to1. A constructor that accept 2 arguments representing an initial value for each of the fields. Accessor/Getter Methods: (Use appropriate method names) dependents() A function to return the number of dependents. income() A function to return the annual income amount. Mutator/Setter Methods: (Use appropriate method names) dependents() A function that has an integer formal argument that is assigned to the number of dependents field. income() A function that...arrow_forwardIN PYTHON PLEASE, THANK YOU!!!!arrow_forwardCreate a Java instance class named Rectangle that has two integer fields named length and width. Include two onstructors: a default constructor to initialize each of the fields to 1 and a second constructor that takes two rguments. Define a getter method for each of the fields.arrow_forward
- Hi, this is a java programming question, I'll attach the image and type the question Implement the class diagram below (diagram attached) Create a new class called LibraryManagementService and implement the main method. Inside the main method:• Create the following book objects.o Title: Sherlock Homeso Author: Arthur Conan Doyleo Genre: Detective fictiono Title: Pride and Prejudiceo Author: Jane Austeno Genre: Fictiono Title: Anne of Green Gableso Author: Jane Eyreo Genre: Dramao Title: Leave it to PSmitho Author: P G Wodehouseo Genre: Comedyo Title: Angels and Demonso Author: Dan Browno Genre: Suspense• All titles are case insensitive (Sherlock Homes and SHERLOCK HOMES should refer to the same book)• By default, for all the books, isAvailable should be true• Implement the following methods in the Library class:o addBook() should take in a book object and should add it to the books array. For instance, if we create a 6th book object• Title: Jurassic Park• Author: Michael Crichton•...arrow_forwardJava Question - Instructions are in the attached pictures. The picture titled "Screenshot..." are the instructions for building the specific code, while the "Final Output" picture shows what the output of the code should look like. Please make sure no errors show up in the Java compiler. Thank you.arrow_forward19 We have been dealing with colors as tuples or lists. We could also create a Color class. This would allow us to create new color objects and pass them around. For each method below, write and implementation that matches the content of the method docstring. Recall that individual color channels must have a value between 0 and 255. class Color: """ This class provides a representation of a color """ definit_(self, red, green, blue): Initialize the color with red, green, and blue values 663939arrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Text book imageDatabase System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationText book imageStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONText book imageDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- Text book imageC How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONText book imageDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningText book imageProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Text book image
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Text book image
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Text book image
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
Text book image
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Text book image
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Text book image
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education