I am new to C++ and in need of assistance with this program.
I can not get this program to display "Name for student1 is unassigned and ssn is 999999999" and to display next "Name for student2 is John Doe and ssn is 123456789". Thank you, for your help.
I can not get this program to display "Name for student1 is unassigned and ssn is 999999999" and to display next "Name for student2 is John Doe and ssn is 123456789". Thank you, for your help.
Code:
#include <iostream>
#include <iomanip>
#include <string>
using namespace std;
class Student
{
private:
char name[80]; // Student Name
int SSN; // Social Sercurity Number (SNN)
public:
student();
student(char name[80],int SNN);
void setstudent(char name[80]= unassigned,int SNN = 999999999);
int setSSN; // should not accept 1 argument and update
int getSSN(); // getSSN should return the class SSN
void char setname();
void char getname();
void display();
};
Student :: Student()
{
Name = "Unassigned"; // A Default constructor
SSN = 999999999; // A Default constructor
}
Student :: Student(char Name[80],int SSN)
{
Name = "John Doe"; // Student Name
SSN = 123456789; // // Social Sercurity Number (SNN)
}
char Student :: getname()
{
return name;
}
int Student :: getSSN()
{
return SSN;
}
void Student :: display ()
{
cout<<"Name for Student 1 is"<<name1<<"and"<<SSN1<<endl;
cout<<"Name for Student 2 is"<<name2<<"and"<<SSN2<<endl;
}
int main ()
{
int SSN1,SSN2;
char name1, name2;
display();
return 0;
}
Comment