// #include<bits/stdc++.h>
#include<iostream>
#include<vector>
using namespace std;
class Student{
public:
vector<double> theoryGrades;
int noOfTheory;
Student(int n){
noOfTheory=n;
for(int i=0;i<noOfTheory;i++){
double v; cin>>v;
theoryGrades.push_back(v);
}
}
// Student(int noOfTheory)
virtual double calculateCGPA(){
double tot=0;
for(int i=0;i<noOfTheory; i++){
tot+=theoryGrades[i];
}
return tot/noOfTheory;
}
};
class BscStudent: public Student{
public:
vector<double> labGrades;
int noOfLabs;
BscStudent(int nt, int nl):Student(nt){
noOfLabs=nl;
for(int i=0;i<noOfLabs;i++){
double v; cin>>v;
labGrades.push_back(v);
}
}
double calculateCGPA() override{
double tot=0;
for(int i=0;i<noOfTheory; i++){
tot+=theoryGrades[i];
}
for(int i=0;i<noOfLabs; i++){
tot+=labGrades[i];
}
return tot/(noOfTheory+noOfLabs);
}
};
class L4Student: public BscStudent{
public: double thesisGrade;
L4Student(int nt, int nl, double tg): BscStudent(nt, nl), thesisGrade(tg){}
double calculateCGPA() override{
double tot=0;
for(int i=0;i<noOfTheory; i++){
tot+=theoryGrades[i];
}
for(int i=0;i<noOfLabs; i++){
tot+=labGrades[i];
}
tot+=thesisGrade;
return tot/(noOfTheory+noOfLabs+1);
}
};
class MscStudent: public Student{
public: double projectGrade, thesisGrade;
MscStudent(int n, double pg, double tg): Student(n), projectGrade(pg), thesisGrade(tg){}
double calculateCGPA() override{
double tot=0;
for(int i=0;i<noOfTheory; i++){
tot+=theoryGrades[i];
}
tot+=projectGrade+thesisGrade;
return tot/(noOfTheory+2);
}
};
void scholarshipAmount(Student *s){
double cg=s->calculateCGPA();
cout<<"CGPA: "<<cg<<endl;
if(cg >= 3.80){
cout<<"Scholarship amount: 10,000 BDT\n";
return;
}
if(cg >= 3.70){
cout<<"Scholarship amount: 5,000 BDT\n";
return;
}
cout<<"No scholarship\n";
}
int main(){
// Derived1 d1;
// Derived2 d2;
// Base *b=new Derived2;
// b->f1();
L4Student l4(3, 2, 4.00);
scholarshipAmount(&l4);
return 0;
}