Levels Tought:
Elementary,Middle School,High School,College,University,PHD
Teaching Since: | Apr 2017 |
Last Sign in: | 12 Weeks Ago, 1 Day Ago |
Questions Answered: | 4870 |
Tutorials Posted: | 4863 |
MBA IT, Mater in Science and Technology
Devry
Jul-1996 - Jul-2000
Professor
Devry University
Mar-2010 - Oct-2016
I NEED HELP WITH THIS ASAP HAVE TO SUBMIT IT TODAY. AS I AM STUCK IN AN EMERGENCY. PLEASE REFER TO THE FOLLOWING ATTACHED FILE. THANK YOU.
1 P5.1 Given the following student class interface, a) implement all member functions of the class, b) implement all
non-member external functions of the class, and c) write a main() function to generate an output similar to the sample
output appeared after the class interface. Notice that not all pre- and post-conditions for functions are provided; some
are intentionally left out for you to fill in. // **** student class interface for P4.1 ****
class student
{
public:
student();
student(string, int, double);
void inputStuRec();
// prompts the user to enter name (for simplicity, last name only), credits completed and GPA
// Postcondition: Data mambers of the calling object is filled with values entered by the user
void outputStuRec();
// Postcondition: contents of the calling object is displayed in a format shown in the sample output
void setName(string& str);
// "Mutator" or "mutator function"
// Postcondition: data member name of the calling object has been set to str
void setCredits(int);
void setGPA(double);
void setStuRec(string, int, double);
bool comapreName(student& obj2);
// Name of the calling object is comapare to that of obj2
// Postcondition: if calling object > obj2, returns true; otherwise, return false
bool compareGPA(student& obj2);
// GPA of the calling object is comapare to that of obj2
// Postcondition: if calling object > obj2, returns true; otherwise, return false
void swap(student& obj2);
// Postcondition: contents of the calling object and obj2 are swapped
private:
string name;
// Last name only
int credits;
double GPA;
}; // **** External functions ****
int fillStuArray(student, int size);
// prompt the user to enter up to “size” (the capacity of the array) student records
// Postcondition: student array has been filled with n records with values entered by the user, where n <= size; the value of n is returned
void sortStuArrayByName(student, int n);
// Postcondition: student array has been sorted by student name in alphabetical order
void displayStuReport(student, int n);
// Postcondition: n student records stored in the student array are displayed Sample output: 2 P5.2 Given the following student class interface, a) implement all member functions of the class, b) implement all
non-member external functions of the class, and c) write a main() function to generate an output similar to the sample
output appeared after the class interface. Notice that not all pre- and post-conditions for functions are provided; some
are intentionally left out for you to fill in. // **** student class interface for P4.2 ****
#include <iostream>
#include <string>
#include <iomanip>
using namespace std; class student
{
public:
student();
student(string, int, double);
string getName();
// "Accessor" or "accessor function"
// Postcondition: returns the GPA of the calling object 3
int getCredits();
double getGPA();
void setName(string& str);
// "Mutator" or "mutator function"
// Postcondition: data member name of the calling object has been set to str
void setCredits(int);
void setGPA(double);
void setStuRec(string, int, double);
private:
string name;
int credits;
double GPA;
}; // Last name only // **** External functions for P4.2 ****
void inputStuRec(student& obj);
// prompts the user to enter values to fill obj
// Postcondition: obj is filled with user entered values
void outputStuRec(student& obj);
// Postcondition: contents of obj is displayed
int fillStuArray(student, int size);
void sortStuArrayByName(student, int n);
void displayStuReport(student, int n);
void swap(student&, student&);
bool compareName(student& obj1, student& obj2);
bool compareGPA(student& obj1, student& obj2); P5.3 Enhance either P4.1 or P4.2 by allowing the user to enter full name for each student in the format of Last-name,
First-Name, e.g., Doe, John.
-----------