find and fix all the errors so the code can run #ifndef Student.h #define Student.h class CStudent{ private: char Student_name[50]; int Student_id; char Student_email_username[10]; char Student_major[10]; float Student_grades[5]; float Student_score; char Student_email_

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

find and fix all the errors so the code can run

#ifndef Student.h
#define Student.h

class CStudent{
private:
char Student_name[50];
int Student_id;
char Student_email_username[10];
char Student_major[10];
float Student_grades[5];
float Student_score;
char Student_email_password[10];

public:
CStudent();

char *get_Student_name();
int get_student_id();
char *get_Student_email_username();
char *get_Student_major();
float *get_Student_grades();
float get_Student_score();
char *get_Student_email_password();


//set methods
void set_Student_name(char *name);
void set_student_id(int id);
void set_Student_email_username(char *username);
void set_Student_major(char *major);
void set_Student_grades(float *grades);
void set_Student_score(float score);
void set_Student_email_password(char *password);

};

#endif

#include "Student.h"
#include <cstddef>

CStudent::CStudent()
{
Student_name[50]={};
Student_id=0;
Student_email_username[10]={};
Student_major[10]={};
Student_grades[5]=0;
Student_score=0;
Student_email_password[10]={};
}

char CStudent:: *get_Student_name()
{
return Student_name;
}
CStudent::~CStudent(){delete s[];}
int CStudent:: get_Student_id()
{
return Student_id;
}
char CStudent:: *get_Student_email_username()
{
return Student_email_username;
}

char CStudent:: *get_Student_major()
{
return Student_major;
}

float CStudent:: *get_Student_grades()
{
return Student_grades;
}

float CStudent:: get_Student_score()
{
return Student_score;
}
char CStudent:: *get_Student_email_password()
{
return Student_email_password;
}

 

void CStudent:: set_Student_name(char *name)
{
Student_name=name;
}
void CStudent:: set_Student_id(int id)
{
Student_id=id;
}
void CStudent:: set_Student_email_username(char *username)
{
Student_email_username=username;
}
void CStudent:: set_Student_major(char *major)
{
Student_major=major;

}
void CStudent:: set_Student_grades(float *grades)
{
Student_grades=grades;
}
void CStudent:: set_Student_score(float score)
{
Student_score=score;
}
void CStudent:: set_Student_email_password(char *password)
{
Student_email_password=password;
}
void CStudent:: getStudentInfo(){
CStudent (char Student_name[50], int Student_id, char Student_email_username[10], char Student_major[10],
float Student_grades[5], float Student_score, char Student_email_password[10])
{

cout<<"The student's name:"<<Student_name<<endl;

cout<<"The student's id:"<<Student_id<<endl;
cout<<"The student's email username:"<<Student_email_username<<endl;
cout<<"The student's major:"<<Student_major<<endl;
cout<<"The student's grades:"<<Student_grades<<endl;
cout<<"The student's score:"<<Student_score<<endl;
cout<<"The student's email password:"<<Student_email_password<<endl;
}
void calculateGPA(char Student_name[50], int Student_id, char Student_email_username[10], char Student_major[10],
float Student_grades[5], float Student_score, char Student_email_password[10])
{
int sum;
cout<<"Enter the no of students";
cin>>n;
for(int j=0;j<n;j=j+5)
{
for(int i=0;i<5;i++)
{
sum=sum+grades[i];
}
student_score=sum/100;
}
}

void registerStudent()
{

char Student_name[50];

cout<<"please enter student's name:";
getline(Student_name, 50);

int Student_id;

cout<<"please enter student's id:";
cin>>Student_id;

char Student_email_username[10];
// prompt for the student's Email
cout<<"please enter student's email username:";
getline(Student_email_username, 10);

char Student_major[10];
cout<<"please enter student's major:";
getline(Student_major, 10);


float Student_grades[5];

for (int i=1; i<=5; i++)
{
cout<<"please enter student's grades in Subject "<<i <<" :";
cin>>Student_grades[i];
}

float Student_score;
cout<<"please enter student's score:";
cin>>Student_score;

char Student_email_password[10];
cout<<"please enter student's email password:";
getline(Student_email_password, 10);

}

 

 

Expert Solution
steps

Step by step

Solved in 2 steps with 6 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY