0% found this document useful (0 votes)
43 views10 pages

Kineme

The document describes a C++ program for a student management system. It includes functions for adding student details, viewing grades, checking individual students, and listing all registered students. The main function displays a menu to call these different options.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
43 views10 pages

Kineme

The document describes a C++ program for a student management system. It includes functions for adding student details, viewing grades, checking individual students, and listing all registered students. The main function displays a menu to call these different options.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 10

#include <iostream>

#include <string>
using namespace std;

int c, age[300], idnum[300], month[300], date[300], year[300], s_year[300],


num, index[300],rollnum[300];
float avg[300], uself[300], ppc[300], pe[300], math[300], cp[300], itc[300],
nstp[300];
string course[500], address[500], name[500], gender[500];
char block[300];

void repeat();
void addstudent();
void grades();
void gchecker();
void regstudents();
void top();
void failed();
void pass();
void menu();

int main(){
int grade;
system("color a");
char c;
system("cls");
do {
system("cls");
system("color e");
cout << "\n\n";
cout <<"================= STUDENT MANEGEMENT =================" << endl;
cout << endl;
cout << "\t\t1. MENU\n\n";
cout << "\t\t2. GROUP MEMBER\n\n";
cout << "\t\t3. Failed & Passed\n\n";
cout << "\t\t4. Exit\n\n";
cout << "SELECT YOUR CHOICE : ";
cin >> c;
system("cls");
switch (c)
{
case '1':
{
menu();
break;
}
case '2':
{
///The Groups 6 (6_9)
cout << "\n\n";
cout << "\t GROUP 6
\n\n";
cout << "\t NAME Section Course
\n\n";
cout << "\t 1. Joel Labasa 1A BSIT
\n\n";
cout << "\t 2. Jomelson Maligsa 1A BSIT
\n\n";
cout << "\t 3. Marvel Gabriel 1A BSIT
\n\n";
cout << "\t 4. Nina Bulusan 1A BSIT
\n\n";
cout << "\t 5. Bryne Ramos 1A BSIT
\n\n";
cout << "\t 6. Hazel Baquing 1A BSIT
\n\n";
cout << "\n\n";
cout << "\t\t\t\t\t\t\t\t\t SUBMITED TO: Arjay F. Ordonio\n";
cout << "\t\t\t\t\t\t\t\t\t SUBMITED DATE: 12/13/2022 ";
cout << "\n\n";
system("pause");
break;
}
case '3':
int grade;
cout << "Enter your Grade: ";
cin >> grade;
if (grade >= 80) {
cout << "\n\n\n\tPassed" << endl;
cout << "\n\n\nEnter any key to Back: ";
cin>>c;
}
else if (grade >= 71) {
cout << "\n\n\n\tFailed" << endl;
cout << "\n\n\nEnter any key to Back: ";
cin>>c;
}
else {
cout << "\n\n\n\tInvalid grade" << endl;
cout << "\n\n\nEnter any key to back: ";
cin>>c;
break;
case '4':

cout<<"\n\n\n\n\tThank for Used for this Program Goodbye ^∆^\n\n\


n";
exit(0);

break;
default:
cout<<"\n\n\n\n\t1 to 6 ONLY SELECTED ORDER TO BE USE!!!!..\n\n\n";
cout<<"\n\n\tEnter any key to return: \n";
system("pause");
}
}
}
while (c != '4');
}
/////==============================================================================
======
///Student Personal Details
///
===================================================================================
==
///name
void fname() {
cin.ignore();
getline(cin, name[num - 1]);
}

///age
void fage() {
cin >> age[num - 1];
if (cin.fail()) {
cin.clear();
cin.ignore();
fage();
}
}

///Birthday
void c_bday(){
cout << "\tMonth: ";
cin >> month[num - 1];
if (cin.fail()) {
cin.clear();
cin.ignore();
}

///date
cout << "\tDate: ";
cin >> date[num - 1];

if (cin.fail()) {
cin.clear();
cin.ignore();
}

///year
cout << "\tYear:";
cin >> year[num - 1];

if (cin.fail()) {
cin.clear();
cin.ignore();
}
}
///gender
void c_gender() {

cin >> gender[num - 1];


if (cin.fail()) {
cin.clear();
cin.ignore();
c_gender();
}
}

///years
void c_syear() {

cin >> year[num - 1];


if (cin.fail()) {
cin.clear();
cin.ignore();
c_syear();
}
}

///Section
void c_block() {

cin >> block[num - 1];


if (cin.fail()) {
cin.clear();
cin.ignore();
c_block();
}
}

///Course
void c_course() {
cin.ignore();
getline(cin,course[num - 1]);
}

///Adress
void c_address(){
cin.ignore();
getline(cin, address[num - 1]);
}

///Roll
void roll() {
rollnum[num - 1] = num;
cin >> idnum[num - 1];
if (cin.fail()) {
cin.clear();
cin.ignore();
roll();
}
}

///AddStudent
void addstudent() {
cout << "ENTER" << endl;
cout << "Roll number: ";
cin >> num;
if (cin.fail()) {
cin.clear();
cin.ignore();
addstudent();
}
cout << "ID Number: ";
roll();
cout << "Name: ";
fname();
cout << "Age:";
fage();
cout << "B-day: (Tip Numbers only)\n";
c_bday();
cout << "Gender:";
c_gender();
cout << "address: ";
c_address();
cout << "course: ";
c_course();
cout << "block: ";
c_block();
cout << "school year:";
c_syear();

system("CLS");
grades();
repeat();

///Repeated
void repeat() {
system("CLS");
cout << "\n\n1.Main menu\n\n2.Add Another Student\n\n3.Exit\n" << endl;
cout << "Choose the number: ";
cin >> c;
if (cin.fail()) {
cin.clear();
cin.ignore();
system("CLS");
repeat();
}
switch (c) {
case 1:
system("CLS");
menu();
break;
case 2:
system("CLS");
addstudent();
break;
case 3:
exit(0);
default:
system("CLS");
cout << "please choose again:\n" << endl;
repeat();
}
}

///All Students Grades


void grades() {
float sum = 0;
cout << "ENTER GRADES\n" << endl;
cout << "understanding the self: ";
cin >> uself[num - 1];
cout << "philippine popular culture: ";
cin >> ppc[num - 1];
cout << "physical education: ";
cin >> pe[num - 1];
cout << "math in the modern world: ";
cin >> math[num - 1];
cout << "computer programing: ";
cin >> cp[num - 1];
cout << "introduction to computing: ";
cin >>itc [num - 1];
cout << "national service training program: ";
cin >> nstp[num - 1];
sum = uself[num - 1] + ppc[num - 1] + pe[num - 1] + math[num - 1] + cp[num -
1] + itc[num - 1] + nstp[num - 1];
avg[num - 1] = sum / 7;
cout << avg[num - 1];
}

///Numbering Listed
void gchecker(){
cout << "Enter student Roll Number\n" << endl;
cin >> num;
if (cin.fail()) {
cin.clear();
cin.ignore();
system("CLS");
addstudent();
}

if (idnum[num - 1] == 0) {
cout << "there is no student student registered in the roll number " <<
num << endl;
}
else if (idnum[num - 1] > 0) {
cout << "Roll Number: " << rollnum[num - 1] << endl;
cout << "NAME: " << name[num - 1] << "\n" << endl;
cout << "\tSUBJECT GRADES" << endl;
cout << "Understanding the self: \t" << uself[num - 1] <<
endl;
cout << "Philippine popular culture: \t" << ppc[num - 1] <<
endl;
cout << "Physical education: \t" << pe[num - 1] << endl;
cout << "Math in the modern world: \t" << math[num - 1] <<
endl;
cout << "Computer programing: \t" << cp[num - 1] << endl;
cout << "Introduction to computing: \t" << itc[num - 1] <<
endl;
cout << "National service training program: \t" << nstp[num - 1] <<
endl;
}
cout << "\n" << endl;
cout << "1.back\n2.check another student grade\n\n" << endl;
cout << "choose the number: ";
cin >> c;
if (cin.fail()) {
cin.clear();
cin.ignore();
}
switch (c) {
case 1:
system("CLS");
menu();
break;
case 2:
system("CLS");
gchecker();
break;
default:
system("CLS");
cout << "invalid input\n" << endl;
gchecker();
}
}

///Show All Data Student Recorded


void regstudents() {
for (int i = 0;i < 300;i++) {
//if (idnum[num - 1] == 0) {
//cout << "there is no student student registered in the roll number "
<< num << endl;

if (idnum[i] > 1) {
cout << "Roll Number: " << rollnum[i] << endl;
cout << "Name: " << name[i] << endl;
cout << "STUDENT ID number: " << idnum[i] << endl;
cout << "Age: " << age[i] << endl;
cout << "B-day mm/dd/yy: Tip:Number Only\n";
cout << month[i] << "/" << date[i] << "/" << year[i] << "\n";
cout << "Gender: " << gender[i] << endl;
cout << "Address: " << address[i] << endl;
cout << "School year: " << s_year[i] << endl;
cout << "Block: " << block[i] << endl;
cout << "Course: " << course[i] << endl;
cout << "Student average: " << avg[i] << endl;
cout << endl;
cout <<
"==================================================================================
=================\n" << endl;
}
}

cout << "end of the list\n" << endl;


cout << "1.back\n\n" << endl;
cout << "choose the number: ";
cin >> c;
switch (c) {
case 1:
system("CLS");
menu();
break;
default:
system("CLS");
cout << "invalid input\n" << endl;
regstudents();
}
}

///A Student Who Failed


void failed() {
for (int i = 0;i < 300;i++) {
if (avg[i] <= 74) {
if (avg[i] > 0) {
cout << "student " << name[i] << " failed with the average of "
<< avg[i] << endl;
cout << endl;
cout << "==============================================\n" <<
endl;
}

}
}
cout << "end of the list\n" << endl;
cout << "1.back\n\n" << endl;
cout << "choose the number: ";
cin >> c;
switch (c) {
case 1:
system("CLS");
menu();
break;
default:
system("CLS");
cout << "invalid input\n" << endl;
failed();
}
}

///Student Passed
void pass() {
for (int i = 0;i < 300;i++) {
if (avg[i] >= 75) {
cout << "Student " << name[i] << " passed with the average of "
<< avg[i] << endl;
cout << endl;
cout <<
"===========================================================\n" << endl;
}
}
cout << "end of the list\n" << endl;
cout << "1.back\n\n" << endl;
cout << "choose the number: ";
cin >> c;
switch (c) {
case 1:
system("CLS");
menu();
break;
default:
system("CLS");
cout << "invalid input\n" << endl;
pass();
}

///Top Students
void top() {
int x;
float temp, tavg[300];
for (int i = 0;i < 300;i++) {
tavg[i] = avg[i];
}
for (int i = 0;i < 300;i++) {
index[i] = i;
}
for (int i = 0;i < 300;i++) {
for (int j = i + 1;j < 300;j++) {
if (tavg[i] < tavg[j])
{
temp = tavg[i];
tavg[i] = tavg[j];
tavg[j] = temp;

x = index[i];
index[i] = index[j];
index[j] = x;
}
}
}

int a = 1;
cout << "TOP 10 STUDENTS\n" << endl;
for (int i = 0; i < 10;i++) {
cout << a++ << ". " << name[index[i]] << " with the average of " <<
avg[index[i]] << endl;
}
cout << endl;
cout << "end of the list\n" << endl;
cout << "if data show blank or zero there is no stored data \n" << endl;
cout << "1.back\n\n" << endl;
cout << "choose the number: ";
cin >> c;
switch (c) {
case 1:
system("CLS");
menu();
break;
default:
system("CLS");
cout << "invalid input\n" << endl;
failed();
}

///Second Menu
void menu() {
cout << "======================== STUDENT MANAGEMENT ====================\n"
<< endl;
cout << "\n\t\tMENU:\n" << endl;
cout << "\n\t\t1.ADD STUDENT\n\n\t\t2.TOP 10\n\n\t\t3.FAILED\n\n\t\t4.PASSED\
n\n\t\t5.SHOW ALL STUDENT\n\n\t\t6.STUDENT GRADE\n\n\t\tENTER ANY KEY TO EXIT\n\n\
n" << endl;
cout << "\n\n\t\tSELECT YOUR CHOICE: ";
cin >> c;
if (cin.fail()) {
cin.clear();
cin.ignore();
system("CLS");
main();
}
switch (c) {
case 1:
system("CLS");
cout << "Add Student\n" << endl;
addstudent();
break;
case 2:
system("CLS");
top();
break;
case 3:
system("CLS");
cout << "Failed Students\n" << endl;
failed();
break;
case 4:
system("CLS");
cout << "Passed Students\n" << endl;
pass();
break;
case 5:
system("CLS");
cout << "Registered Students\n" << endl;
regstudents();
break;
case 6:
system("CLS");
cout << "Student Grade\n" << endl;
gchecker();
break;
default:
cout << "Input is not in the choices\n" << endl;
system("CLS");
cout << "please choose again:\n" << endl;
main();
break;
}
}

You might also like