Registration Window
Enter student ID
The student should not be a fee defaulter if yes then do not register student
The pre requisite of course should be passed. if fail do not register for the course
If the students CGPA is a above 3.0 register all courses.
If the CGPA is above 2.0 register 3 courses.
If CGPA less than 2.0 then register 2 courses with a warning.
#include<iostream>
class Student
{
public:
Student();
~Student();
std::string name;
std::string surname;
int id;
double cgpa;
private:
};
Student::Student()
{
}
Student::~Student()
{
}
int main()
{
Student student;
std::cout << "Enter student name : ";
std::cin >> student.name;
std::cout << "Enter student surname : ";
std::cin >> student.surname;
std::cout << "Enter student id : ";
std::cin >> student.id;
std::cout << "Enter student CGPA : ";
std::cin >> student.cgpa;
if (student.cgpa >= 3.0)
{
std::cout << "All courses registered\n";
}
else if (student.cgpa >= 2.0)
{
std::cout << "3 courses registered\n";
}
else if (student.cgpa < 2.0)
{
std::cout << "Warning , yout cgpa is less than 2\n";
std::cout << "2 courses registered\n";
}
system("pause");
return 0;
}
Comments
Leave a comment