Starting Out with Python (4th Edition)
4th Edition
ISBN: 9780134444321
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Concept explainers
Textbook Question
Chapter 11, Problem 3MC
Suppose a program uses two classes: Airplane and Jumbo Jet. Which of these would most likely be the subclass?
a. Airplane
b. JumboJet
c. Both
d. Neither
Expert Solution & Answer
Learn your wayIncludes step-by-step video
schedule02:47
Students have asked these similar questions
Design an Essay class that is derived from the GradedActivity class presented in thischapter. The Essay class should determine the grade a student receives on an essay.The student’s essay score can be up to 100, and is determined in the following manner:• Grammar: 30 points• Spelling: 20 points• Correct length: 20 points• Content: 30 pointsDemonstrate the class in a simple program.
Implement the following using JAVA:
a.Design a class named Person and its two subclasses named Student andEmployee.
b.Make Faculty and Staff subclasses of Employee.
Please note that,● A person has a name, address, phone number, and email address. A student has aclass status (freshman,sophomore, junior, or senior). You can define the status as aconstant.● An employee has office & salary.● A faculty member has office hours and a rank.● A staff member has a title.
c. Draw a UML diagram of the system.
answer for task 2 only the question also refers to some of the stuff on task 1 skip 1
Draw the UML class diagrams for the following classes:
An abstract Java class called Person that has the following attributes:
a String called idNumber
a Date called dateOfBirth representing the date of birth.
a String for name
A class called VaccineRecord with the following attributes:
an enum called type of VaccineType
a Date called date
a String called batchCode
A class called Patient that extends the Person class and has the following attributes and behaviours:
an ArrayList that contains VaccineRecord objects called vaccinationRecord
a public method called vaccinate that takes a VaccineRecord with the following signature:
public void vaccinate(VaccineRecord vaccineRecord);
a public boolean method called isVaccinated that returns whether or not the Patient has had a vaccine.
A MedicalPractitioner class that extends the Person class and has the following attributes and behaviours:
a…
Chapter 11 Solutions
Starting Out with Python (4th Edition)
Ch. 11.1 - In this section, we discussed superclasses and...Ch. 11.1 - Prob. 2CPCh. 11.1 - What does a subclass inherit from its superclass?Ch. 11.1 - Look at the following code, which is the first...Ch. 11.2 - Look at the following class definitions: class...Ch. 11 - In an inheritance relationship, the ___________ is...Ch. 11 - In an inheritance relationship, the _________ is...Ch. 11 - Suppose a program uses two classes: Airplane and...Ch. 11 - This characteristic of object-oriented programming...Ch. 11 - Prob. 5MC
Ch. 11 - Polymorphism allows you to write methods in a...Ch. 11 - It is not possible to call a superclasss _ _init_...Ch. 11 - A subclass can have a method with the same name as...Ch. 11 - Only the _ _init_ _method can be overridden.Ch. 11 - You cannot use the isinstance function to...Ch. 11 - What does a subclass inherit from its superclass?Ch. 11 - Look at the following class definition. What is...Ch. 11 - Prob. 3SACh. 11 - Write the first line of the definition for a...Ch. 11 - Look at the following class definitions: class...Ch. 11 - Look at the following class definition: class...Ch. 11 - Employee and ProductionWorker Classes Write an...Ch. 11 - ShiftSupervisor Class In a particular factory, a...Ch. 11 - Person and Customer Classes The Person and...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
Dynamic String Stack Design a class that stores strings on a dynamic stack. The strings should not be fixed in ...
Starting Out with C++ from Control Structures to Objects (9th Edition)
The decimal number 17 is equal to the binary number 10010 11000 10001 01001
Digital Fundamentals (11th Edition)
Suppose your code creates an object of the class Scanner named keyboard (as described in this chapter). Write c...
Absolute Java (6th Edition)
Which category of C++ reference variables always produces aliases?
Concepts Of Programming Languages
3.12 (Date Create a class called Date that includes three pieces Of information as data
members—a month (type ...
C++ How to Program (10th Edition)
Which loop should you use when you know the number of required iterations?
Starting Out with Java: From Control Structures through Objects (6th Edition)
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
- Write the program for creating classes and objectarrow_forwardConsider the following class public class Ketchup extends Food implements Tasty{ public String brand; private Snack snack; } Select ALL that are correct based this class. Ketchup is a Food Ketchup is a Tasty Ketchup is an Object Ketchup is a Snack Food is a Tasty Snack is a Tasty Food is a Snackarrow_forwardA class may be made immutable in a number of ways. with the aid of an illustrationarrow_forward
- subject: object-oriented programming in your library there are two types of books. one category is literature books and the second category is generals. litrature books have the authorID, authorname literature theme language, publisher, volumn,, yearofpubication, journal have attributes volumn, issue, publisher,yearofpublication,journalID, technical sponser. design a parent class books extend two classes literaturebooks and journel from parent class make constructor , setter, and getterarrow_forwardjava languageCreate a class with following attributes: The car's make The car's model The car's year Now let's identify the class's methods. Specifically, the actions are: Constructor of Car class Set and get the car's make Set and get the car's model Set and get the car's year Now create few instance of the Car in a Test class. Use getter and setter to set the instance variables. Create a class with following attributes: The car's make The car's model The car's year Now let's identify the class's methods. Specifically, the actions are: Constructor of Car class Set and get the car's make Set and get the car's model Set and get the car's year Now create few instance of the Car in a Test class. Use getter and setter to set the instance variables.arrow_forwardThe Essay class has a default constructor, a constructor with two parameters, and a constructor with three parameters. Declare the following objects: essay1 with no arguments essay2 with essayTitle and essayAuthor as arguments essay3 with essayTitle, essayAuthor, and essayYear as arguments Ex: If the input is Painting Cole 1919, then the output is: Essay: Undefined, Unspecified, 0 Essay: Painting, Cole, 0 Essay: Painting, Cole, 1919 Archive.java public class Archive { publicstaticvoidmain(String[] args) { Scannerscnr=newScanner(System.in); StringessayTitle; StringessayAuthor; intessayYear; essayTitle=scnr.next(); essayAuthor=scnr.next(); essayYear=scnr.nextInt(); /* Your code goes here */ essay1.print(); essay2.print(); essay3.print(); } } Essay.java public class Essay { private String title; private String author; private int year; public Essay() { // Default constructor title = "Undefined"; author = "Unspecified"; year = 0; }…arrow_forward
- Write the PYTHON Programs for the following exercises 2. For each program, you need to write: Comments for all the values, constants, and functions IPO Variables Pseudocode shift supervisor Class IN A FACTORY, a shift supervisor is a salaried employee who supervises a shift. In addition to a salary, the shift supervisor earns a yearly bonus when his or her shift meets production goals. Write a ShiftSupervisor class that is a subclass of the Employee class The Shift Supervisor class should keep a data attribute for the annual salary, and a data attribute for the annual production bonus that a shift supervisor has earned. Demonstrate the class by writing a program that uses a ShiftSupervisor objectarrow_forwardjava program 1. Write a Park class with the following class variables: 1) String ParkName; 2) int ParkID; 3) String ParkShape; and 4) double ParkLength. Please implement the following methods: i) ParkNameGetter(): Return the name of the park. ii) ParkIDGetter(): Return the ID of the park. iii) ParkLengthGetter(): Return the length of the park. Note that, 1) ParkLength is private while the other variables are public. 2) ParkShape only includes “Circle” and “Square”. 3) Parks may have the same name, but ParkID is unique. 4) Students should create the correct constructor. 2. Write a ParkClient class. i) Create an array of Park: - ParkArray has 5 elements; - Set the first park in ParkArray with the following parameters: ParkName: BIRCH, ParkID: 20, ParkShape: “Circle”, ParkLength: 5. - Set the second park in ParkArray with the following parameters: ParkName: BIRCH, ParkID: 23, ParkShape: “Square”, ParkLength: 6. - Randomly Set the other three parks in ParkArray. ii) Print out the…arrow_forward1. Write the java code for the following class diagram. Mention the method overridden. Vehicle Car void: stop() int: speed() int :speed() void :m agearrow_forward
- Create a class student and then create an object of this class and work with it. Idfirst namelast namegradesdate of birthfield of studyenrolled coursesenrolled semester using constructors, setters-getters in JAVA programmingID must be generatedarrow_forward1. Create a Person class. The variables are name, height, and age. 2. Create a Student class that is a child class (i.e. inherits from) Person. Student should have variables address and school.arrow_forwardPet.java - An abstract class to represent the concept of a pet. A pet should have a name, a gender and a sound (choose appropriate data-types for these). Dog.java - an implementation of the pet concept. A dog should have a "woof" sound, and it should have a Bone (see Bone.java description below). Cat.java - an implementation of the pet concept. A cat should have a "meoh" sound, and it should have a Fish (see Fish.java description below). Bone.java - should be a minimal class which composes a String "$==$" which is its printString (further, a toString() method should be implemented that returns the printString. Fish.java - similar to Bone.java only the printString is "}==*-> PersonWithAPet.java - should contain a class Person which contains a Pet reference. There should be a method to setPet(:Pet) that accepts any subclass of Pet Runner.java - should be the main class that executes to create a Cat with a Fish, a Dog with a Bone, - two Person objects (one with the Cat, one with the Dog,…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Introduction to Classes and Objects - Part 1 (Data Structures & Algorithms #3); Author: CS Dojo;https://www.youtube.com/watch?v=8yjkWGRlUmY;License: Standard YouTube License, CC-BY