
Concept explainers
A Barbershop Quartet is a group of four singers: a lead, a tenor, a bass, and a baritone. These four singers harmonize to produce a purely American form of music developed in the 19th century. Consider the incomplete class definitions below.
public class BarberShopQuartet
{
public BarberShopQuartet()
{
Tenor highSinger = new Tenor();
Baritone bari = new Baritone();
Lead melody = new Lead();
Bass lowSinger = new Bass();
System.out.println(“Quartet created.”);
}
}
______________________________________________________________________________
public class Singer
{
public Singer()
{
System.out.println(“Singing...”);
}
}
______________________________________________________________________________
public class Tenor extends Singer
{
public Tenor()
{
System.out.println(“Singing...the high notes”);
}
}
______________________________________________________________________________
public class Baritone extends Singer
{
public Baritone()
{
System.out.println(“Singing...harmonizing with the lead”);
}
}
______________________________________________________________________________
public class Lead extends Singer
{
public Lead()
{
System.out.println(“Singing...the melody and providing the
emotion”);
}
}
______________________________________________________________________________
public class Bass extends Singer
{
public Bass()
{
System.out.println(“Singing...the very low notes”);
}
}
Which of the following IS-A, HAS-A relationships is true?
A. |
A Baritone has-a BarberShopQuartet. |
|
B. |
A Singer has-a Lead. |
|
C. |
A BarberShopQuartet is-a Singer. |
|
D. |
A Singer has-a BarberShopQuartet.
|
|
E. |
A Tenor is-a Singer. |

Trending nowThis is a popular solution!
Step by stepSolved in 3 steps

- Chapter 10 defined the class circleType to implement the basic properties of a circle. (Add the function print to this class to output the radius, area, and circumference of a circle.) Now every cylinder has a base and height, where the base is a circle. Design a class cylinderType that can capture the properties of a cylinder and perform the usual operations on the cylinder. Derive this class from the class circleType designed in Chapter 10. Some of the operations that can be performed on a cylinder are as follows: calculate and print the volume, calculate and print the surface area, set the height, set the radius of the base, and set the center of the base. Also, write a program to test various operations on a cylinder.arrow_forwardUsing 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_forwardAt most, a class can contain ____________ method(S). 0 1 2 any number ofarrow_forward
- Systems ArchitectureComputer ScienceISBN:9781305080195Author:Stephen D. BurdPublisher:Cengage LearningC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENT
- Programming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,C++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology Ptr




