A small university has no more than 250 faculty members. A class called faculty
ID: 3776289 • Letter: A
Question
A small university has no more than 250 faculty members. A class called faculty Type stores faculty data including first name, last name, department, salary, and number of years of service. The university uses a C++ main() program which stores faculty data in an array of facultyType objects called Faculty. The university is able to perform the following actions: Add a new faculty member Increase all faculty members salary by a designated percent Output faculty information for all faculty who have more than 15 years of service Functions in main() are used to perform these actions. W rite the class definition of the class facultyType. It will have the usual print and setAll functions; add other set and get functions as needed. Write the function definitions of the facultyType class functions. Choose one of the main( ) program functions in the bulleted list above, and w rite it. (For the first bullet, assume that one of the parameters of your function is the index in the Faculty array where the new one is to be added). Indicate the function you choose here: Describe the actual differences between a struct and a class. Describe the use of a struct versus a class in the customary practice of programmers.Explanation / Answer
5 a. There is some differences between struct and class,
struct is a kind of ADT that is Abstract data type which divides a particular given memory corresponding to the structure specification.
class is a other different type of abstract data type which used to information hiding.
struct members---Public by default
class members---Private by default
for example,
struct struct_name
{
int a; //public
};
class class_name
{
int a; //private
};
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.