Starting out with Visual C# (4th Edition)
4th Edition
ISBN: 9780134382609
Author: Tony Gaddis
Publisher: PEARSON
expand_more
expand_more
format_list_bulleted
Textbook Question
Chapter 10, Problem 11MC
A class that is not intended to be instantiated, but used only as a base class, is called a(n) __________.
- a. dummy class
- b. subclass
- c. virtual class
- d. abstract class
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Programming Language = Python
1. Employee and ProductionWorker Classes
Write an Employee class that keeps data attributes for the following pieces of information:
• Employee name
• Employee number
Next, write a class named ProductionWorker that is a subclass of the Employee class. The ProductionWorker class should keep data attributes for the following information:
• Shift number (an integer, such as 1, 2, or 3)
• Hourly pay rate The workday is divided into two shifts: day and night. The shift attribute 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. Write the appropriate accessor and mutator methods for each class.
Once you have written the classes, write a program that creates an object of the ProductionWorker class and prompts the user to enter data for each of the object’s data attributes. Store the data in the object and then use the object’s accessor methods to retrieve it and display it on the…
A class is made abstract by declaring that class virtual. T/F
Child Class: Vegetable
Write a child class called Vegetable. A vegetable is described by a name, the number of grams of sugar (as a whole number), the number of grams of sodium (as a whole number), and whether or not the vegetable is a starch.
Core Class Components
For the Vegetable class, write:
the complete class header
the instance data variables
a constructor that sets the instance data variables based on parameters
getters and setters; use instance data variables where appropriate
a toString method that returns a text representation of a Vegetable object that includes all four characteristics of the vegetableJava
Chapter 10 Solutions
Starting out with Visual C# (4th Edition)
Ch. 10.1 - In this section, we discussed base classes and...Ch. 10.1 - Prob. 10.2CPCh. 10.1 - What does a derived class inherit from its base...Ch. 10.1 - Look at the following code, which is the first...Ch. 10.1 - Briefly summarize the constructor issues in...Ch. 10.2 - Look at the following class definitions: class...Ch. 10.2 - Does the is a relationship work in reverse? Why or...Ch. 10.3 - What is the purpose of an abstract class?Ch. 10.3 - If a class is abstract, what cannot be done with...Ch. 10.3 - If a class is derived from a base class that has...
Ch. 10.3 - What must be done with an abstract property before...Ch. 10.3 - How can you create an abstract read-only property?Ch. 10 - When one object is a specialized version of...Ch. 10 - In an inheritance relationship, the_______ is the...Ch. 10 - In an inheritance relationship, the___________ is...Ch. 10 - Base classes are sometimes called____________. a....Ch. 10 - Derived classes are sometimes called______________...Ch. 10 - The refers to the base class. a. friend keyword b....Ch. 10 - Prob. 7MCCh. 10 - When a derived class method has the same name as a...Ch. 10 - The declares that a derived class is allowed to...Ch. 10 - The declares that this method overrides a method...Ch. 10 - A class that is not intended to be instantiated,...Ch. 10 - To declare a class as abstract, you use the...Ch. 10 - A regular, nonabstract class is sometimes called a...Ch. 10 - A(n) __________ is a method that appears in a base...Ch. 10 - A(n) __________ is a property that appears in a...Ch. 10 - __________ allows a base class reference variable...Ch. 10 - The base class inherits fields, properties, and...Ch. 10 - Polymorphism allows a class variable of the base...Ch. 10 - Properties in a base class cannot be overridden in...Ch. 10 - A base class reference variable can reference an...Ch. 10 - A statement that tries to use the new operator to...Ch. 10 - A class that is not intended to be instantiated,...Ch. 10 - When an abstract property appears in a class, it...Ch. 10 - What does a derived class inherit from its base...Ch. 10 - Look at the following code, which is the first...Ch. 10 - Can methods in the derived class directly access...Ch. 10 - When you create an instance of a derived class,...Ch. 10 - In what kind of situation would you want to use an...Ch. 10 - What is primary difference between an abstract...Ch. 10 - Can abstract classes also contain abstract...Ch. 10 - Write the first line of the definition for a...Ch. 10 - Look at the following class declarations: class...Ch. 10 - Write a parameterized constructor for a base class...Ch. 10 - Prob. 4AWCh. 10 - Create an abstract class called Star. Include an...Ch. 10 - Employee and ProductionWorker Classes Create an...Ch. 10 - ShiftSupervisor Class In a particular factory, a...Ch. 10 - TeamLeader Class In a particular factory, a team...Ch. 10 - Person and Customer Classes Design a class named...Ch. 10 - PreferredCustomer Class A retail store has a...
Additional Engineering Textbook Solutions
Find more solutions based on key concepts
Find out if your compiler supports variable-length arrays. If it does, write a small program to test the featur...
Programming in C
Car Loan If A dollars are borrowed at r interest compounded monthly to purchase a car with monthly payments for...
Introduction To Programming Using Visual Basic (11th Edition)
Solar System Use the Circle class to draw each of the planets of our solar system. Draw the sun first, then eac...
Starting Out with Java: From Control Structures through Objects (7th Edition) (What's New in Computer Science)
Markup Write a program that asks the user to enter an items wholesale cost and its markup percentage. It should...
Starting Out with C++: Early Objects
True or False: By default all members of an interface are public.
Starting Out with Java: From Control Structures through Data Structures (3rd 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
- Using classes, design an online address book to keep track of the names, addresses, phone numbers, and dates of birth of family members, close friends, and certain business associates. Your program should be able to handle a maximum of 500 entries. Define a class addressType that can store a street address, city, state, and ZIP code. Use the appropriate functions to print and store the address. Also, use constructors to automatically initialize the member variables. Define a class extPersonType using the class personType (as defined in Example 10-10, Chapter 10), the class dateType (as designed in this chapters Programming Exercise 2), and the class addressType. Add a member variable to this class to classify the person as a family member, friend, or business associate. Also, add a member variable to store the phone number. Add (or override) the functions to print and store the appropriate information. Use constructors to automatically initialize the member variables. Define the class addressBookType using the previously defined classes. An object of the type addressBookType should be able to process a maximum of 500 entries. The program should perform the following operations: Load the data into the address book from a disk. Sort the address book by last name. Search for a person by last name. Print the address, phone number, and date of birth (if it exists) of a given person. Print the names of the people whose birthdays are in a given month. Print the names of all the people between two last names. Depending on the users request, print the names of all family members, friends, or business associates.arrow_forwardParent Class: Food Write a parent class called Food. A food is described by a name, the number of grams of sugar (as a whole number), and the number of grams of sodium (as a whole number). Core Class Components For the Food class, write: the complete class header the instance data variables a constructor that sets the instance data variables based on parameters getters and setters; use validity checking on the parameters where appropriate a toString method that returns a text representation of a Food object that includes all three characteristics of the food Class-Specific Method Write a method that calculates what percent of the daily recommended amount of sugar is contained in a food. The daily recommended amount might change, so the method takes in the daily allowance and then calculates the percentage. For example, let's say a food had 6 grams of sugar. If the daily allowance was 24 grams, the percent would be 0.25. For that same food, if the daily allowance was 36 grams, the…arrow_forward__________ allows a base class reference variable to reference a derived class object. a. Polymorphism b. Inheritance c. Generalization d. Specializationarrow_forward
- 1. Employee and ProductionWorker Classes Write an Employee class that keeps data attributes for the following pieces of information: Employee name Employee number Next, write a class named ProductionWorker that is a subclass of the Employee class. The ProductionWorker class should keep data attributes for the following information: Shift number (an integer, such as 1, 2, or 3) Hourly pay rate The workday is divided into two shifts: day and night. The shift attribute 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. Write the appropriate accessor and mutator methods for each class. Once you have written the classes, write a program that creates an object of the ProductionWorker class and prompts the user to enter data for each of the object’s data attributes. Store the data in the object, then use the object’s accessor methods to retrieve it and display it on the screen. 2. ShiftSupervisor Class In a…arrow_forwardLook at the following class definitions:class Plant:def _ _init_ _(self, plant_type):self._ _plant_type = plant_typedef message(self):print("I'm a plant.")class Tree(Plant):def _ _init_ _(self):Plant._ _init_ _(self, 'tree')def message(self):print("I'm a tree.")Given these class definitions, what will the following statements display?p = Plant('sapling')t = Tree()p.message()t.message()arrow_forwardöclhäll daila Declare an abstract class named A that contains: 1-A private static integer variable called C 2-A private integer variable called id 3-A constructor with no argument that sets id = 4-A public method Area() that returns 1.2 5-An abstract method getName () id + C Declare a derived class from A called B that contains: 1- Two integer variables x and y 2- A constructor to initialize the fields of B class 3- Two accessor methods getx() and gety() that return the values of - An overridden method getName() that returns the name of the class and y reclare a derived class from B called Circle that contains: - A protected double variables radius - A constructor to initialize the fields of Circle - An overridden method getName() that returns the name of the class - An overridden method Area() that calculates and B classes and returns the of Circle ite a test program to invoke the different methods declared in B and Circle classes areaarrow_forward
- Declaring a class virtual transforms it into an abstract class. T/Farrow_forwardemployee and production worker classes write an employee class that keeps data attributes for the following pieces of information: • employee name • employee number next, write a class named productionworker that is a subclass of the employee class. the productionworker class should keep data attributes for the following information: • shift number (an integer, such as 1, 2, or 3) • hourly pay rate the workday is divided into two shifts: day and night. the shift attribute 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. write the appropriate accessor and mutator methods for each class. once you have written the classes, write a program that creates an object of the productionworker class and prompts the user to enter data for each of the object’s data attributes. store the data in the object, then use the object’s accessor methods to retrieve it and display it on the screen. satak overfallowarrow_forwardExercises abstract class • Design a new Triangle class that extends the abstract GeometricObject class: • Draw the UML diagram for the classes Triangle and GeometricObject • Implement the Triangle class • Write a test program that prompts the user to enter three sides of the triangle, a color, and a Boolean value to indicate whether the triangle is filled: • The program should create a Triangle object with these sides and set the color and filled properties using the input • The program should display the area, perimeter, color, and true or false to indicate whether it is filled or notarrow_forward
- An interface is a collection of _______ that a class can implementarrow_forwardExercise 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_forwardNewspaperSubscriber class- create an abstract class named NewspaperSubscriber with attributes to contain the subscriber’s street address and the subscription rate. Include get and set methods for both these attributes. The set method for the rate is abstract. The setAddress method must prompt the user to enter the subscriber’s address through the use of a dialog box. Create a constructor for the base class. Create a toString() method that concaternates and returns the subscriber’s street address and rate for display. Create 3 child classes named SevenDaySubscriber, Weekday Subscriber, and Weekend Subscriber. Each child class has an additional attribute called subType, which is a String, that will store the type of newspaper subscription. Create a setType method that will set the type of subscriber as follows: “Seven Day”, “Weekday”, or“Weekend”. Create a setRate method for each child class that sets the rate as follows: a SevenDaysubscriber pays R18.00 per week for his newspapers, a…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,
- C++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher: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,
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Memory Management Tutorial in Java | Java Stack vs Heap | Java Training | Edureka; Author: edureka!;https://www.youtube.com/watch?v=fM8yj93X80s;License: Standard YouTube License, CC-BY