Answer to Question #227233 in C++ for sandyJay

Question #227233

program that determine if a student qualifies for the NSFAS through their Average score for Maths, English and Physics. The program must receive 3 marks for each subject in order to calculate the average to determine whether or not a student qualifies for NSFAS

1. Prompt the user to capture marks for Maths, Physics and English

2. The funding amounts are broken down as follows, an average marks of : a) 75% & above - R75000 b) 60% up to 74% - R60000 c) 50% up to 59% - R40000

3. The program must displayed at the end of all the operations:

The number of NSFAS funded students

The number of students who received R75000, R60000 & R40000

The number of non NSFAS funded students

4. Your output must test the four conditions:

2 NSFAS qualifying students and 2 non-qualifying students

2 NSFAS students qualifying for R75000 & 1 non-NSFAS qualifying student

2 NSFAS students qualifying for R60000 & 1 non-NSFAS qualifying

2 NSFAS students qualifying for R40000 & 1 non-NSFAS qualifying


1
Expert's answer
2021-08-18T17:52:45-0400
#include <iostream>
 
using namespace std;
 
int main()
{
	int F[3];
	int M[3];
	int E[3];
	int numberOfStudent;
	int total;
	int NSFAS75 = 0, NSFAS60 = 0, NSFAS50 = 0, NSFASnon = 0;
	cout << "Enter number of students: ";
	cin >> numberOfStudent;
	for (int i = 0; i < numberOfStudent; i++)
	{
		cout << "***Next student***" << endl;
		cout << "Enter marks for maths: ";
		cin >> M[0] >> M[1] >> M[2];
		cout << "Enter marks for physics: ";
		cin >> F[0] >> F[1] >> F[2];
		cout << "Enter marks for english: ";
		cin >> E[0] >> E[1] >> E[2];
		total = (M[0] + M[1] + M[2] + F[0] + F[1] + F[2] + E[0] + E[1] + E[2]) / 9;
		if (total >= 75) NSFAS75++;
		if (total >= 60 && total < 75) NSFAS60++;
		if (total >= 50 && total < 60) NSFAS50++;
		if (total < 50) NSFASnon++;
	}
	cout << "The number of NSFAS funded students: " << numberOfStudent << endl;
	cout << "The number of students who received R75000: " << NSFAS75 << endl;
	cout << "The number of students who received R60000: " << NSFAS60 << endl;
	cout << "The number of students who received R40000: " << NSFAS50 << endl;
	cout << "The number of non NSFAS funded students: " << NSFASnon << endl;
	cout << endl;
	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
APPROVED BY CLIENTS