Which of the following are valid declarations for an assignment operator for a class named myClass?

a. void friend operator = (myClass& left, const myClass& source);
b. void operator = (myClass& left, const myClass& source);
c. void friend operator = (const myClass& source);
d. void operator = (const myClass& source);


d. void operator = (const myClass& source);

Computer Science & Information Technology

You might also like to view...

What objects are involved in a airplane flight?

What will be an ideal response?

Computer Science & Information Technology

Modify the method drawFace to take the width and height of the desired face and calculate the positions based on the desired width and height.

What will be an ideal response?

Computer Science & Information Technology

An analysis of the income and expense for each month is called a break-even analysis

Indicate whether the statement is true or false

Computer Science & Information Technology

Create an application that allows the user to inventory DVDs. Users input the title of the DVD and bonus materials and that information is stored in an object. The GUI is provided for you (Fig. 18.43). You will create a class (DVDInfo) to represent the DVD object and another class (BonusInfo) to represent bonus materials for a DVD object such as the movie’s trailer.


a) Copying the template to your working directory. Copy the C:Examples Tutorial18ExercisesDVDInventory directory to your C:SimplyJava directory.
b) Opening the Command Prompt window and changing directories. Open the Com- mand Prompt window by selecting Start > Programs > Accessories > Command Prompt. Change to your working directory by typing cd C:SimplyJavaDVD- Inventory.
c) Opening the template files. Open the DVDInventory.java, DVDInfo.java and
BonusInfo.java files in your text editor.
d) Creating the BonusInfo class. View the BonusInfo class. Add code to this class so that its objects will each represent one bonus material item on the DVD. Each BonusInfo object should have a name (name) and a length (itemLength). Use this tutorial’s CookingTime class as your guide in creating the get and set methods for the name and length of each bonus material. Have your set methods truncate a name
longer than twenty characters and set the minutes of a

Computer Science & Information Technology