1 Here is my question and I had attached 4acpp file also ie

1: Here is my question and I had attached 4a.cpp file also i.e 4th picture.
2: we need to add code to work properly and send me code as well as out picture on my details.
AT&T; 1:56 AM blackboard.saumag.edu MCIS 6204 Data Structure and Algorithms (Labs) (Adapted from Dr. Cline) Lab #5: A. Objected Oriented Programming Lab#5A Object Oriented C++ is an \"Object Oriented\" language. Object-oriented programming allows you to define your own class types and define operations that work on them. This can be enormously useful in a complex application. For example, in a banking application, the programmer can define account\" objects that hold information about different bank accounts. This allows the programmer to encapsulate data in meaningful groupings, and provide operations that make sense for those data units, such as \"deposif\" or withdraw\". This Lab is intended to give You some practice creating a class with a constructor method, accessor methods, mutator methods function. Directions . LabSA Type Lab4A.cpp into the editor. Add your name and section name on the top. Also, fill in your student ID where it says TYour name here], and Myour section name]-(Your ID) 1.1 Build and run LabSA.cpp ff Student Nane:

Solution

Please find the answer to the above question as follows:-

#include<iostream>
#include<string.h>
using namespace std;

class Student{
private:
string name;
int idNum;
double gpa;
public:
Student(){}
Student(string, int, double);
string getName(){
return name;
}
void setStudentName(string n){
name = n;
}
string formatString(){

}
int getidNum(){
return this->idNum;
}
double getGPA(){
return gpa;
}
void setidNum(int a){
idNum = a;
}
void setGPA(double a){
gpa = a;
}
};

Student::Student(string a, int b, double c){
setStudentName(a);
setidNum(b);
setGPA(c);
}

int main(){
const string Name = \"John Smith\";
const int STUID = 123456789 ;
const double GPA1 = 4.0;
const double GPA2 = 2.34;

Student stu1;
stu1 = Student(Name, STUID, GPA1);

cout<<\"Name: \"<<stu1.getName()<<endl;
cout<<\"Id Number: \"<<stu1.getidNum()<<endl;
cout<<\"GPA: \"<<stu1.getGPA()<<endl;

stu1.setGPA(GPA2);
cout<<\"Student Name: \"<<stu1.getName()<<endl;
cout<<\"Student Id num: \"<<stu1.getidNum()<<endl;
cout<<\"Student GPA: \"<<stu1.getGPA()<<endl;

const string Name2 = \"Pistol Pete\";
const int STUID2 = 1;
Student stu2;
stu2 = Student(Name2, STUID2, GPA1);

cout<<\"Name: \"<<stu2.getName()<<endl;
cout<<\"Id Number: \"<<stu2.getidNum()<<endl;
cout<<\"GPA: \"<<stu2.getGPA()<<endl;
cout<<\"Student Name: \"<<stu2.getName()<<endl;
cout<<\"Student Id num: \"<<stu2.getidNum()<<endl;
cout<<\"Student GPA: \"<<stu2.getGPA()<<endl;
}

1: Here is my question and I had attached 4a.cpp file also i.e 4th picture. 2: we need to add code to work properly and send me code as well as out picture on m
1: Here is my question and I had attached 4a.cpp file also i.e 4th picture. 2: we need to add code to work properly and send me code as well as out picture on m

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site