Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

I\'m not really sure how to answer the question below. There are two parts. Any

ID: 3584085 • Letter: I

Question

I'm not really sure how to answer the question below. There are two parts. Any help would be appreciated.

Question:

Consider a program that will read employee information into an array of objects, sort the array by employee identification number, write out the sorted array, and compute various statistics on the data, such as the average age of an employee.

A) Write complete specifications for this problem and design a modular solution. What classes and methods did you identify during the design of your solution?

B) Write specifications, including preconditions and post-conditions, for each method. Write specifications for a function that advances any given date by one day.

Explanation / Answer

#include #include #include #include // For this program I am using a vector #include using namespace std; //-------------------------------------------------------------------------- // Constant global unchangeable variables... const int MaxEmployees = 5; //-------------------------------------------------------------------------- // class (Employee) declaration... class Employee { public: int ID; // public access data member... // Automatic inline functions, less typing void SetAge(int ItsAge){Age = ItsAge;} int GetAge() const {return Age;} void SetName(string ItsName) {Name = ItsName;} string GetName() const{return Name;} void SetAddress(string ItsAddress) {Address = ItsAddress;} string GetAddress() const {return Address;} // Outline function. This function will be passed as an argument to the // for_each() to calculate the sum. I calculated the average externally // to the classes; I only used the average age in the main function and // for display purposes only. friend bool compare_id(const Employee &emp1, const Employee &emp2); private: int Age; string Name; string Address; }; bool compare_id(const Employee &emp1, const Employee &emp2) { if(emp1.ID
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote