VB icon

Grade Evaluator in C++

Email
Submitted on: 8/5/2016 12:19:45 PM
By: Jake R. Pomperada  
Level: Beginner
User Rating: Unrated
Compatibility: C++ (general)
Views: 1021
author picture
 
     Here is another example of my work in C++ to compute and evaluate the grades of the student whether the student, pass or failed in the subject. The code using two dimensional array as its data structure and looping statements. I hope you will find my work useful in learning C++ programming. Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com. My mobile number here in the Philippines is 09173084360.
 
code:
Can't Copy and Paste this?
Click here for a copy-and-paste friendly version of this code!
				
//**************************************
// Name: Grade Evaluator in C++
// Description:Here is another example of my work in C++ to compute and evaluate the grades of the student whether the student, pass or failed in the subject. The code using two dimensional array as its data structure and looping statements. I hope you will find my work useful in learning C++ programming.
Add me at Facebook my address is jakerpomperada@gmail.com and jakerpomperada@yahoo.com.
My mobile number here in the Philippines is 09173084360.
// By: Jake R. Pomperada
//**************************************

#include <iostream>
#include <iomanip>
using namespace std;
main() {
 int grades[5][1],pass=0,failed=0,out_range=0;
 int row=0, col=0;
 string remarks;
 char letter_grade;
 cout << "\t Grades Evaluator Version 1.0";
 cout << "\n\n Created By: Mr. Jake Rodriguez Pomperada,MAED-IT";
 cout << "\n\n";
 
 for ( row=0; row < 5; row++) {
for (col=0; col < 1; col++) {
 cout << "Enter grade : " ;
 cin >> grades[row][col];
 }
}
 // Code to check for remarks
cout <<"\n" << setw(5) << "GRADES" <<
setw(7) << " EQUIV " <<
setw(10) << "REMARKS";
cout << "\n\n";
 for ( row=0; row < 5; row++) {
for (col=0; col < 1; col++) {
 if (grades[row][col] >= 75) {
 remarks = "PASSED";
 pass++;
 }
 else if (grades[row][col] < 50)
 {
remarks= " Error Out of Range ";
out_range++;
 }
 else if (grades[row][col] < 75){
 remarks = "FAILED";
 failed++;
 }
 
 // Letter Grade Equivalent
 if (grades[row][col] >= 90 && grades[row][col] <= 100 ) {
letter_grade = 'A';
 }
 else if (grades[row][col] >= 80 && grades[row][col] <= 89 ) {
letter_grade = 'B';
 }
 else if (grades[row][col] >= 70 && grades[row][col] <= 79 ) {
letter_grade = 'C';
 }
 else if (grades[row][col] >= 60 && grades[row][col] <= 69 ) {
letter_grade = 'D';
 }
else if (grades[row][col] >= 50 && grades[row][col] <= 59 ) {
letter_grade = 'F';
 }
else if (grades[row][col] < 50) {
letter_grade = 'X';
 }
cout <<"\n" << setw(5) << grades[row][col]
 << setw(6) << letter_grade << setw(12)
 << remarks; 
 } 
 }
 
 cout << "\n\n";
 cout << "\nNumber of Passed Grades " << pass << ".";
 cout << "\nNumber of Failed Grades " << failed << ".";
 cout << "\nNumber of Out of Range Grades "<< out_range << ".";
 cout << "\n\n";
 system("PAUSE"); 
 
}


Other 69 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments


 There are no comments on this submission.
 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.