Answer to Question #297029 in C++ for mak

Question #297029

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.


1
Expert's answer
2022-02-12T11:07:58-0500
#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;
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog