What is a friend function and how is it declaredwhich


Discussion Questions

Please respond to all of the following prompts:

• What is a friend function and how is it declared?
• Which operators cannot be overloaded and why?
• What is a macro in C++ programming and what are some advantages to using them?
• Explain the purpose of an inline function?

Lab Activity

1. This week you will modify the Week 5 C++ program to code friend function.

• To complete this activity, please refer to: Programming Problems 15.1, page 738, #2.

It sometimes happens at a hotel that a guest wants to be transferred from one room to another. In the Hotel Room class of Chapters 11 and 12, add a friend function Transfer() that transfers a guest from one room to another. The func¬tion should have two arguments. The first argument should be the number of the room you are transferring guests from; the second argument should be the room number you are transferring guests to. The function should make appropriate changes to the occupancy status of both rooms Code a mai no to test the new f ri end function.

2. Write an original C++ program based on the requirements listed in the final project.

• To complete this activity, please refer to the following document in DocSharing: Week 6 Final Programming Project.

• Submission Instructions: ***NOTE: For all C++ assignments, include a screenshot of your C++ program in the Visual Studio window along with the output showing or submit the actual program file. Do this for all labs.

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: What is a friend function and how is it declaredwhich
Reference No:- TGS01609014

Expected delivery within 24 Hours