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
Python Programming
A- Define a class called Vehicle as follows:
- The Vehicle class has two instance variables:
- name,
- max_speed
- Define an __init__ function for the Vehicle class that initializes the name and max_speed instance variables
- Define get and set methods for each of the name and max_speed variables. You may call them getName, getMax_speed, setName and setMax_speed
- Define a __str__ function that prints the name and max_speed of the Vehicle class.
B- Define a class called Car as follows:
- The Car class isa subclass of the Vehicle class.
- The Car class has an instance variable called number_of_cylinders
- Define an __init__ function for the Car class that initializes the name and max_speed and number_of_cylinders instance variables
- Please note that the Car class inherits the name and max_speed variables from the Vehicle class and does not redefine them.
- Define get and set methods for the number_of_cylinders variable.
- Define a __str__ function that prints the name and max_speed and number_of_cylinders of the Car class.
C- Define a class called Airplane as follows:
- The Airplane class isa subclass of the Vehicle class.
- The Airplane class has an instance variable called number_of_engines
- Define an __init__ function for the Airplane class that initializes the name and max_speed and number_of_engines instance variables
- Please note that the Airplane class inherits the name and max_speed variables from the Vehicle class and does not redefine them.
- Define get and set methods for the number_of_engines variable.
- Define a __str__ function that prints the name and max_speed and number_of_engines of the Airplane class.
D- Define a function that performs the following:
- Creates an instance of a Car class and an instance of an Airplane class.
- You may call them myCar and myAirplane and choose values for their name, speed, number_of_cylinders, and number_of_engines instance variables
- Call all the get methods that are accessible to the myCar and myAirplane instances and print the returned value.
- Please note that the get methods of the Vehicle super class is available to the Car and Airplane sub classes.
- Increase the max_speed value of the myCar by 50 miles and increase the max_speed value of the myAirplane by 100 miles, by calling their setName and setMax_speed functions.
- print both myCar and myAirplane objects.
- Compare the max_speeds of myCar and myAirplane objects and print which one is faster.
- You may call them myCar and myAirplane and choose values for their name, speed, number_of_cylinders, and number_of_engines instance variables
Expert Solution
Check MarkThis question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
bartleby
This is a popular solution
bartleby
Trending nowThis is a popular solution!
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
- Employee and ProductionWorker ClassesCreate an Employee class that has properties for the following data:Employee nameEmployee numberNext, create a class named ProductionWorker that is derived from the Employee class. The ProductionWorker class should have properties to hold the following data:Shift number (an integer, such as 1, 2, or 3)Hourly pay rateThe workday is divided into two shifts: day and night. The Shift property will hold an integer value representing the shift that the employee works. The day shift is shift 1 and the night shift is shift 2.Create an application that creates an object of the ProductionWorker class and lets the user enter data for each of the object’s properties. Retrieve the object’s properties and display their values. this.ReportViewer1.Employee(); cannot reference?arrow_forwardc++ class runner with constructor and COPY CONSTRUCTORarrow_forwardA Mutator function within a class must have access to the private data item but Accessor functions should not. True False Question 32 4 pts The private and public areas of a class can appear in any order. In other words the public declarations or private declarations can come first...it does not matter. True Falsearrow_forward
- Fill-in-the-Blank A constructor that takes a single parameter of a type different from the class type is a __________ constructor.arrow_forwardC++arrow_forwardThe following class definitions and function definitions should be used to help you finish the exam. train.h: car.h: #ifndef CAR_H #define CAR_H using namespace std; class Car #include "car.h" using namespace std; #ifndef TRAIN_H #define TRAIN_H class Train { private: Car* tHead; Car* tTail; public: Train(); -Train(); void addcarBack(Car *); void deleteFirstcar(); void removeFirstcaróftype(const string &); { private: string name; double maxSpeed; public: Car* nextcar; public: car(); Car(string); double getMaxspeed () const; string getName() const; void setName(const string &); }; #endif // Display list car by car void display() const; }; #endif Part of train.cpp: // addcarBack logic: if (traincarsHead == 0) { traincarsHead = toAdd; traincarsTail = toAdd; else { traincarstail->nextcar = toAdd; traincarsTail = toAdd;arrow_forward
- Exercise 1-Account class • Design a class named Account that contains : • A private int data field named id for the account • A private double data field named balance for the account • A privet Date data field named dateCreated that stores the date when the account was created • A no-arg constructor that creates a default account • A constructor that creates an account with the specified id and initial balance • The getters (i.e., accessors) and setters (i.e., mutators) methods for id and balance • The getter method for dateCreated • A method named withdraw that withdraws a specified amount from the account • A method named deposit that deposits a specified amount to the accountarrow_forwardUsing C# language: Programming PLO-2 Measured: Design, implement, and evaluate computer solutions utilizing structured and object-oriented programming methodologies. Design a class named Contractor. The class should keep the following information: Contractor name Contractor number Contractor start date Write one or more constructors and the appropriate accessor and mutator functions for the class.arrow_forwardPlease include java doc commentarrow_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