Kineme
Kineme
#include <string>
using namespace std;
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':
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() {
///years
void c_syear() {
///Section
void 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();
}
}
///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();
}
}
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;
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;
}
}