jeffcruz 0 Newbie Poster

I have this assignment;


Create a class named Student. The class should consist of the following private member variables: social security number and name (last, first or first, last?). The social security number (SSN) should be a long integer. The name variable should be a character array of 80 characters. (This means use a C-style string only. You may not use a string/String class anywhere.)

Create the following class member functions: setSSN, getSSN, setName, getName. Each of the 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 method should return the class value for name.

Create a default constructor. (This constructor will accept no arguments.) Use the default constructor to initialize the social security number to 999999999 and the name to "unassigned".

Make sure all your methods are defined in the implementation section of the class. Do not use any inline member functions.

Do not print from the Student class. Instead retrieve the data in the main() function and print from main.

Create a main function. In the main method 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.

#include <iostream.h>
#include <stdlib.h>
#include <cstring>
#include <cctype>

class Student
{
    private:
        char Name[80]; 
        long SSN ;

    public:
        Student (char *name);   
        void setSSN (int SSN);  
        void setName (int Name);  
       
        int getSSN ();  
        int getName ();

I'm kind of confused on classes and pointers. Where would I go from here, any tips would help.