A simple program to determine the average, maximum, and minimum age of the students in a class using C++ programming language.
I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me at the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.
My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.
My mobile number here in the Philippines is 09173084360.
Program Listing
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char *argv[])
{
int age[5];
int i,sum=0, avg=0;
int max=0,min=100;
cout << "\n\t===================================================";
cout << "\n\t\t STUDENT AGE DETERMINER 1.0";
cout << "\n\t Created By: Mr. Jake R. Pomperada, MAED-IT, MIT";
cout << "\n\t===================================================";
cout << "\n\n";
for(i=0;i<5;i++)
{
cout << "Enter the age of the student " << i+1 <<":";
cin >> age[i];
}
for(i=0;i<5;i++)
{
sum=sum+age[i];
if(age[i]>max)
{
max=age[i];
}
if(age[i]<min)
{
min=age[i];
}
}
avg=sum/5;
cout << "\n";
cout << " \n\t==========================";
cout << " \n\t==== GENERATED REPORTS ===";
cout << " \n\t==========================";
cout << "\n\n";
cout << "Average age of the students of the class : " << avg << endl;
cout << "Maximum age of the student of the class : " << max << endl;
cout << "Minimum age of the student of the class : " << min << endl;
cout << "\n\n";
system("PAUSE");
return EXIT_SUCCESS;
}
No comments:
Post a Comment