Need help with error on code

Create a class named Student. The class should consist of the following private data members : social security number and name (last, first or first, last?). The social security number (SSN) data member should be an integer. The name data member must be a character array of 80 characters.
Make sure all your member functions are defined in the implementation section of the class. Do not use any inline class member functions.
Create the following class member functions: setSSN, getSSN, setName, getName. Each of these member functions should be public.
The setSSN function should accept 1 argument and update the the social security number member variable. Do not allow the the social security number to be set to zero or less than zero. The getSSN should return the class SSN.

The setName member function should accept one string argument. Use the argument to update the name class member variable. Do not update the class variable for name if the argument has a length of 0. (This indicates the name in the argument is "empty".) The getName member function should return the class value for name. Read here for more information on the getName member function.
Create a default constructor for the Student class. This constructor will accept no arguments. Use the default constructor to initialize the social security number to 999999999 and the name to "unassigned".
Create a main function. In the main function create two Student objects. Use the appropriate get functions to print all the values of all the member variables for the first Student object. For the second object, use the set methods to change the student name to John Doe and the social security number to 123456789. Use the appropriate get functions to print all the values of all the member variables for the second Student object.
Do not print from the Student class. Instead you will retrieve the data in the main() function and print from main. Help with code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
  #include <iostream>
using namespace std;
// class declaration section
class Student
{
private:
	int SSN;
	char Name[80];
public:
	Student(); // default constructor
	Student(int SSN, char Name[80] ); //overloaded constructor
	void setSSN(int);
	int getSSN();
	void setName(char *);
	char getName();

};

//class implementation section//

Student::Student()//default constructor
{
	strcpy_s(Name, sizeof(Name), "unassigned");
	SSN = 999999999;
}
Student::Student(int ssn, char* name)
{
	setSSN(ssn);
	setName(name);
}
void Student::setSSN(int newSSN)
{
	if (SSN>0)
		SSN = newSSN;
}
int Student::getSSN(){
	return SSN;
}
void Student::setName(char* newName)
{
	while (strlen(newName) > 0)
		Name[80] = newName[80];
}
char Student::getName(){
	return Name[80];
}
int main()
{
	Student S1;
	cout << "Name for student1 is " << S1.getName() << " and ssn is " << S1.getSSN() << endl;
 Student S2("John Doe", 123456789);
	cout << "Name for student2 is " << S2.getName() << "and ssn is " << S2.getSSN() << endl;
	return 0;
}


Thi is the error messaage i get
1 IntelliSense: no instance of constructor "Student::Student" matches the argument list
argument types are: (const char [9], int) c:\Users\Computer Work\Documents\Visual Studio 2013\Projects\Student\Student\Student.cpp 53 13 Student
Line 11: Constructor takes an int and a char array in that order.

Line 51: You're passing a char array and an int. You have no constructor that takes a char array and an int in that order.
Thanks
Topic archived. No new replies allowed.