CODE
#include <iostream>
#include <iomanip>
#include <cstring>
using namespace std;
struct STUDENT_STRUC
{
char first_name[40];
char last_name[40];
char social_security_number [12];
float quiz[5];
float exam;
float grade;
};
/*
struct STUDENT_STRUCT
{
char student_size[4];
int first_name, // students first name
last_name, //students last name
social_security_number, //students social security number
tepephone_number, // studnts phone number
};
//void Load_Student_Table(STUDENT_STRUCT [], int);
void Display_Student_Table(STUDENT_STRUCT [], int);
int main()
{
const int STUDENT_SIZE =25;
STUDENT_STRUCT Student_size[STUDENT_SIZE];
int row,
student_quiz =0;
int quiz1, //quiz 1 grade
quiz2, //quiz 2 grade
quiz3, //quiz 3 grade
quiz4, //quiz 4 grade
quiz5, //quiz 5 grade
double average;
const int NUM_STUDENTS = 25;
const int NUM_SIZES = 25;
const int COLLEGE_SUM = 25;
const int TOTALS = 25;
int college_inventory[NUM_SIZES][NUM_STUDENTS];
int total_sizes[TOTALS];
int total_students[STUDENTS_SUM];
int students,
first_name,
last_name,
double student_social_security_number,
telephone number,
cout<< setprecision(2)
<< setiosflags(ios::fixed)
<< setiosflags(ios::showpoint);
//load the table
Load_Student_Table(STUDENT_STRUCT );
for(row=0; row < STUDENT_SIZE; ++row)
student_size += Student_Table[row].average_quizes;
cout<<endl <<endl;
cout<< setw(20) <<" quizes Average is:"
cout<< setw(20) << average_quizes;
cout<<"Please enter Students first_name: ";
cin.getline(first name, 40);
cout<<endl;
cout<<"Please Enter student_ last_name: ";
cin.getline(last_name, 20);
cout<<endl;
cout"Please Enter student_social_security_number: ";
cin.getline(student_social_security_number, 10);
cout<<"Please Enter grade for quiz 1: ";
cin>>quiz1;
cout<<"Please Enter grade for quiz 2: ";
cin>>quiz2;
cout<<"Please Enter grade for quiz 3: ";
cin>>quiz3;
cout<<"Please Enter grade for quiz 4: ";
cin>>quiz4;
cout<<"Please Enter grade for quiz 5: ";
cin>>quiz5;
average= double (quiz1+quiz2+quiz3+quiz4+quiz5) / 5;
cout<<endl;
cout<<"The average of the quizzes is" <<average <<endl;
}
void LoadStudentInfo (STUDENT_STRUCT *student, int Count)
{
cout<<"Please enter Students first_name:";
cin.getline(student->first_name, 40);
cout<<endl;
cout"Please Enter student_social_security_number: ";
cin.getline(student_social_security_number, 10);
for(int i=0: i<5; 1++)
{
cout<<"Please Enter grade for quiz " << (i+1) <<": ";
cin >> student->quiz[i];
}
cout<< "Please enter final exam grade: ";
cin>> student->exam;
return 0;
}