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
Concept explainers
Question
2. Create a SavingsAccount class that behaves just like a BankAccount, but also has an interest rate and a method that increases the balance by the appropriate amount of interest. Supply a test program or driver that tests these classes and methods.
Expert Solution
This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
This is a popular solution
Trending nowThis is a popular solution!
Step by stepSolved in 2 steps
Knowledge Booster
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
- Please write Java Code per the instructions and make sure code compiles before submitting. Thank you!arrow_forwardThis project has 3 classes which are already defined for you. Do not change any of these: Vehicle: an abstract class for any make and model of vehicle that can possibly travel some distance. LimitedRange: an interface for something that has a limit to the distance it can travel. Main: a test program which will work after you have written the code below. Your job is to write the following 3 classes so that this program produces the sample output shown at the end of Main. Specifically you will need: ElectricCar: a vehicle with a limited range. So it must be a subclass of Vehicle, and it must implement LimitedRange. Thus it needs an instance variable for its range, and a travel method (required by Vehicle. Please use @Override) that outputs "Zoom!" if it has enough range to go the distance specified (and update its range). It must have a constructor with 3 arguments as called by main. (Remember that the first line of the constructor must be a call to "super": Vehicle's constructor…arrow_forwardWrite a tester program to test the mobile class defined below. Create the class named with your id (use : Id 190099306) with the main method. Create two mobiles M1 and M2 using the first constructor. Print the characteristics of M1 and M2. Create one mobile M3 using the second constructor. Change the id and brand of the mobile M3. Print the id of M3. Your answer should include a screenshot of the output. public class Mobile { private int id; private String brand; public Mobile() { id = 0; brand = ""; } public Mobile(int n, String name) { id = n; brand = name; } public void setBrand(String w) { brand = w; } public void setId(int w) { id = w; } Public int getId() { return id; } public String getBrand() { return brand; } } please provide me how to do the steps and i will try to work it alone. we didn't study this excersie in the labarrow_forward
- Can you help me with this please: Write the definition of a class swimmingPool, to implement the properties of a swimming pool. Your class should have the instance variables to store the length (in feet), width (in feet), depth (in feet), the rate (in gallons per minute) at which the water is filling the pool, and the rate (in gallons per minute) at which the water is draining from the pool. Add appropriate constructors to initialize the instance variables. Also, add member functions to do the following: determine the amount of water needed to fill an empty or partially filled pool, determine the time needed to completely or partially fill or empty the pool, and add or drain water for a specific amount of time, if the water in the pool exceeds the total capacity of the pool, output "Pool overflow" to indicate that the water has breached capacity. The header file for the swimmingPool class has been provided for reference. Write a program to test your swimmingPool class. An example of…arrow_forwardis this just for the candidate class or is the election class included?arrow_forwardadd a class to package that represents your new drivable type. That type should be something that is capable of being driven (speeding up and slowing down) and therefore a perfect candidate for a class that implements the actions in the Drivable interface.arrow_forward
- Design a class called "Person" with attributes for name, age, and gender. Implement methods to get and set these attributes, and also a method to calculate the person's age in dog years (assuming 1 dog year is equivalent to 7 human years).arrow_forwardWrite a program which controls a metro train and that keeps track of stations and who gets on and off. Design and implement a class called train, which has at least the following: At least the following attributes (you can include others): metroID stationNum which keeps track of the station that the train is at. iii. direction which keeps track of the direction the train is travelling in. passTotal which keeps track of the number of passengers currently on the train. A default constructor which sets the metroID to a random number between 1 and 1000, the station number to 0, the direction (int), and the passTotal to 0 (train is empty). A constructor with one parameter; the parameter is the metro id. The constructor assigns the passed integer to the metroID attribute; the rest of the attributes are set as described in the default constructor. Accessor methods for each attributes. Mutator methods for each attributes. nextStation(int lastStation) which determines the next…arrow_forwardcan someone help me? The questions are: 1. Add an addExerciseAdd method that adds an exercise to a private variable exercises in Exercise You don't need to create a getter or setter for this private variable. 2. Modify the constructors in Exercise so that you can create two types of workouts (let one constructor use the other; each variable can only have a value in one constructor): a training schedule with exercises, but without a trainer. a training schedule with exercises and with a trainer. import java.util.ArrayList;class Exerciseplan {private String customer;private String trainer;Exerciseplan(String customer) {this.customer = customer;}Exerciseplan(String customer, String trainer) {this.customer = customer;this.trainer = trainer;}private void printExercise(String name, String muscleGroup, Integer numberOfSets, Integer repetition, Integer restTime) {System.out.println("Oefening voor " + muscleGroup + ":" +" herhaal " + numberOfSets + " keer " +"(rust tussendoor " + restTime +…arrow_forward
- Create a class Person to represent a person according to the following requirements: A person has two attributes: id Add a constructer to initialize all the attributes to specific values. Add all setter and getter methods. Create a class Product to represent a product according to the following requirements: A product has four attributes: a reference number (can’t be changed) a price an owner (is a person) a shopName (is the same for all the products). Add a constructer without parameters to initialize all the attributes to default values (0 for numbers, "" for a string and null for object). Add a second constructer to initialize all the attributes to specific values. Use the keyword "this". Add the method changePrice that change the price of a product. The method must display an error message if the given price is negative. Add a static method changeShopName to change the shop name. Add all the getter methods. The method getOwner must return an owner. Create the class…arrow_forwardIn Python 3, write a program with classes to keep track of phones. Here are the requirements: Create a new class called Phone. The Phone class should have a class attribute for the owner's name. Since all phones have a manufacturer and a model number, your class should take the manufacturer and model number from the constructor and assign them to instance attributes. Your Phone constructor should be able to take the parameters. Override the print method for Phone to output a human-friendly version of the information. Your code should prompt the user for an owner name and then start prompting for the manufacturers and models for all phones for that user until the user enters a 'q' or 'Q'. After the entry print out a list of all the phones.arrow_forwardConvert the following UML diagram into the Java code. Write constructor, mutator and accessor methods for the given class. Create an instance of Account class in a main method using a Demo class. Note: The structure of the class can be compiled and tested without having bodies for the methods. Just be sure to put in dummy return values for methods that have a return type other than void. Student Student Number Average Mark Is Eligible To Enroll Get Seminars Takenarrow_forward
arrow_back_ios
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education