Answered step by step
Verified Expert Solution
Question
1 Approved Answer
please use following implementation for nested struct struct abc{ // abc member variables struct xyz { // xyz member variables }var; }a; Write a program
please use following implementation for nested struct
struct abc{
// abc member variables
struct xyz
{
// xyz member variables
}var;
}a;
Write a program to help a university system to store records for its employee. You have to perform the following tasks: 1. Define a struct facultyMemberwith the following attributes: - ID number (int) - First Name (string) - Last Name (string) - Designation (string) e.g. Assistant professor, Lecturer etc. 2. Implement a function "void newrecord(facultyMember \& fm)", which will take an argument of FacultyMember type, input values for all the attributes from user, and store it in the argument variable. 3. Implement a function "void printdetails(facultyMember fm)", which will print the values of the variable fm passed as an argument. 4. Implement your main function. Declare a variable of FacultyMember type. Assign values to it using NewRecord function. Print its values using PrintDetails function. 5. Now, declare a FacultyMember type array of size 3 in main( ). Fill the values using newRecord function. (Note that your newRecord can assign value to a single FacultyMember type variable and you cannot change the prototype). 6. Print the values of the above array using PrintDetails Function without changing the prototype. 7. Implement a function "void sortid(facultyMember fm [], int size)", which takes a FacultyMember type array as an argument and its maximum size. You have to sort this array in ascending order with respect to the ID number (use any sorting algorithms). Be careful while swapping the two locations of array. Implement another struct University with the following details: - Name of University (string) - Address (string) - List of faculty Members (FacultyMember type array of size 3) In main ( ), declare a variable myUni of theUniversity type. Set any values to name and address of myUni. Copy the values of the array you declared in step5 into the FacultyMember type array of myUni. Print the details of the myUni. You should use the PrintDetails function for printing the details of Facultymember list of myUni
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started