Starting Out with Programming Logic and Design (4th Edition)
Starting Out with Programming Logic and Design (4th Edition)
4th Edition
ISBN: 9780133985078
Author: Tony Gaddis
Publisher: PEARSON
bartleby

Concept explainers

bartleby

Videos

Textbook Question
Book Icon
Chapter 14, Problem 16MC

The ___________ characteristic of object-oriented programming allows a superclass variable to reference a subclass object.

  1. a. polymorphism
  2. b. inheritance
  3. c. generalization
  4. d. specialization
Blurred answer
Students have asked these similar questions
PLEASE ANSWER IN PYTHON   Scenario:  Campus Pizza is really taking off and your co-founders love the programs you have built. They want you to build an object oriented program for their beverages.   Campus pizza has two beverage options: Soda from the soda fountain, and home-made lemonade which is available as sweetened or unsweetened.   Both beverages are $1.50 for a small, $1.75 for a medium and $2.00 for a large.    Program Guidelines:   Superclass: Create a superclass called "Beverage" that has two attributes: "size" and "price".  "Beverage" should also have a method called "display" that prints out a statement of the size and price of the drink.   Subclasses:  Soda Subclass: Create a subclass "Soda" that inherits all the attributes and methods of Beverage. Lemonade Subclass: Create a subclass "Lemonade" that inherits all the attributes of subclass, but add an attribute called "sugar" for whether the customer wants the lemonade sweetened or unsweetened.  Additionally, edit the…
When a variable declared in a subclass has the same name as a variable declared in a superclass, it is called a _______________ variable.
Form a subclass StateQuarter from the class Coin. A state quarter has a state theme. The toString method should yield a string such as StateQuarter[value=0.25,name=Quarter][state=California] /**   A quarter with a state theme.*/public class StateQuarter extends Coin{   // Type your code here      /**      Constructs a state quarter.      @param aState the state name   */   public StateQuarter(String aState)    {      super(0.25, "Quarter");      // Type your code here   }      /**      Gets the description of this object.      @return a description of this coin   */   public String toString()   {      // Type your code here   }}

Chapter 14 Solutions

Starting Out with Programming Logic and Design (4th Edition)

Ch. 14.2 - Prob. 14.11CPCh. 14.2 - What is a constructor? When does a constructor...Ch. 14.2 - What is a default constructor?Ch. 14.3 - Prob. 14.14CPCh. 14.3 - Suppose a class has a field named description. The...Ch. 14.3 - Prob. 14.16CPCh. 14.4 - Prob. 14.17CPCh. 14.4 - What technique was described in this section for...Ch. 14.4 - What are classes responsibilities?Ch. 14.4 - Prob. 14.20CPCh. 14.5 - In this section, we discussed superclasses and...Ch. 14.5 - Prob. 14.22CPCh. 14.5 - What does a subclass inherit from its superclass?Ch. 14.5 - Look at the following pseudocode; which is the...Ch. 14.6 - Look at the following pseudocode class...Ch. 14 - Prob. 1MCCh. 14 - Prob. 2MCCh. 14 - A(n) ____ is a member of a class that holds data....Ch. 14 - The _________ specifies how a classs field or...Ch. 14 - A classs fields are commonly declared with the...Ch. 14 - Prob. 6MCCh. 14 - In many programming languages, the _____ key word...Ch. 14 - A(n) ____ method gets a value from a class's field...Ch. 14 - A(n) ____ method stores a value in a field or...Ch. 14 - A(n) ____ method is automatically called when an...Ch. 14 - A set of standard diagrams for graphically...Ch. 14 - When the value of an item is dependent on other...Ch. 14 - A classs responsibilities are _____. a. objects...Ch. 14 - In an inheritance relationship, the _____ is the...Ch. 14 - In an inheritance relationship, the _____ is the...Ch. 14 - The ___________ characteristic of object-oriented...Ch. 14 - The practice of procedural programming is centered...Ch. 14 - Object reusability has been a factor in the...Ch. 14 - It is a common practice in object-oriented...Ch. 14 - One way to find the classes needed for an...Ch. 14 - The superclass inherits fields and methods from...Ch. 14 - Polymorphism allows a class variable of the...Ch. 14 - Prob. 1SACh. 14 - Prob. 2SACh. 14 - What is the difference between a class and an...Ch. 14 - In many programming languages, what does the New...Ch. 14 - The following pseudocode statement calls an...Ch. 14 - Prob. 6SACh. 14 - What does a subclass inherit from its superclass?Ch. 14 - Look at the following pseudocode, which is the...Ch. 14 - Prob. 1AWCh. 14 - Look at this partial class definition, and then...Ch. 14 - Look at the following description of a problem...Ch. 14 - In pseudocode, write the first line of the...Ch. 14 - Look at the following pseudocode class...Ch. 14 - Pet Class Design a class named Pet, which should...Ch. 14 - Car Class Design a class named Car that has the...Ch. 14 - Personal Information Class Design a class that...Ch. 14 - Emp1oyee and ProductionWorker Classes Design an...Ch. 14 - Essay Class Design an Essay class that extends the...

Additional Engineering Textbook Solutions

Find more solutions based on key concepts
The following code fragment will not compile. Why? if !x x | y x = 2 + x; else x = x | 3;

Java: An Introduction to Problem Solving and Programming (8th Edition)

What is an object?

Starting Out With Visual Basic (7th Edition)

If the memory cell whose address is 5 contains the value 8, what is the difference between writing the value 5 ...

Computer Science: An Overview (13th Edition) (What's New in Computer Science)

What is a source program? What is an object program?

Problem Solving with C++ (10th Edition)

Knowledge Booster
Background pattern image
Computer Science
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
SEE MORE QUESTIONS
Recommended textbooks for you
  • Text book image
    EBK JAVA PROGRAMMING
    Computer Science
    ISBN:9781337671385
    Author:FARRELL
    Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
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