headers instead of c++

Write your question here.
header files instead of c++ 52


#include <iostream>
using namespace std;
double Maximize(double a, double b);

class Student
{
public:
int ID;
double midterm_exam;
double final_exam;
double final_grade;
// default constuctor
Student ():
ID(0),
midterm_exam(-1),
final_exam (-1),
final_grade (-1)
{}

//constructor
Student(int x, double y, double z)
{
ID= x;
midterm_exam= y;
final_exam = z;
final_grade= Maximize (midterm_exam,final_exam);

}

};
double Maximize(double a, double b)
{
double q,w,e;
q= 0.5*a + 0.5*b;
w= 0.3*a + 0.7*b;
e= 0.6*a + 0.4*b;
double maximum=0;
if (q>w && q>e)
{
maximum= q;
}
else if(w>q && w>e)
{
maximum= w;
}
else
{
maximum= e;
}
return maximum;
}
class Course
{ public:
Student *students;
double midterm_avg;
double final_exam_avg;
double final_grade_avg;
int n_students;

//constructor
Course(Student *X, int y)
{
students= X;
n_students=y;
midterm_avg= Average (students, n_students,'m' );
final_exam_avg= Average (students, n_students,'f');
final_grade_avg= Average (students, n_students,'g');

}
double guess_final_exam(double x);
bool raise(double x);
bool opt_raise(double x);
void print_raises();

double Average (Student a[], int num, char k );
void print_final_grade_statistics();
int firstStudent (Student a[],int num);
int lastStudent (Student a[],int num);

};
Last edited on
Topic archived. No new replies allowed.