56.2k views
2 votes
Which of the following is true if a programmer has to create a class clinic with the following data members and functions? class clinic { int patientrecnum; string patientname; void set details(int num, string name); clinic getdetails(); };

1 Answer

2 votes

The class clinic described in the question has two data members: an integer variable named patientrecnum and a string variable named patientname. It also has two member functions: a void function named setdetails() that takes two arguments (an integer num and a string name) and sets the values of the patientrecnum and patientname variables, and a function named getdetails() that returns a clinic object.

Therefore, the following statement is true:

The class clinic has two data members, an integer named patientrecnum and a string named patientname, and two member functions named setdetails() and getdetails().

User Snochacz
by
7.7k points
Welcome to QAmmunity.org, where you can ask questions and receive answers from other members of our community.