Skip to content

Instantly share code, notes, and snippets.

@tornikegomareli
Created April 11, 2017 17:49
Show Gist options
  • Save tornikegomareli/8c5ada61eda1703026caf5e009963d2b to your computer and use it in GitHub Desktop.
Save tornikegomareli/8c5ada61eda1703026caf5e009963d2b to your computer and use it in GitHub Desktop.
დასამთავრებელია სტუდენტების ჯგუფი #165
#include <iostream>
#include <string>
using namespace std;
class student
{
private:
string student_name;
string Gender;
int Score;
public:
student()
{
}
void AddStudentsRecords(string name, string gender, int score)
{
this->student_name = name;
this->Gender = gender;
this->Score = score;
}
void DeleteStudentsRecords()
{
this->student_name = "O";
this->Gender = "O";
this->Score = 0;
}
void UpdateStudentsRecords(int score)
{
this->Score = score;
}
void ShowAllRecords()
{
cout << " Student Name : " << student_name << endl;
cout << " Student Gender : " << Gender << endl;
cout << " Student Score : " << Score << endl;
}
};
void displaymenu()
{
cout << "============================================" << "\n";
cout << " MENU " << "\n";
cout << "============================================" << "\n";
cout << " 1.Add student records" << "\n";
cout << " 2.Delete student records" << "\n";
cout << " 3.Update student records" << "\n";
cout << " 4.View all student records" << "\n";
cout << " 5.Sort student records by ID" << "\n";
cout << " 6.Sort student records by Total score" << "\n";
cout << " 7.Display average score of a selected student" << "\n";
cout << " 8.Display the highest and the lowest scores" << "\n";
cout << " 9.Search student by ID" << "\n";
cout << " 10.EXIT" << "\n";
}
enum Type
{
FirstStudent = 0,
SecondStudent = 1,
ThirdStudent = 2
};
int main()
{
student st[3];
string name;
string gender;
int score;
int Indexator = 0;
int Answer;
int Numeric = 1;
bool ProgramEnd = true;
while (ProgramEnd)
{
displaymenu();
cout << "Select Answer : ";
cin >> Answer;
switch (Answer)
{
case 1:
cout << " Enter name of the student : ";
cin >> name;
cout << " Enter gender of the student : ";
cin >> gender;
cout << " Enter score of the student : ";
cin >> score;
st[Indexator].AddStudentsRecords(name, gender, score);
Indexator++;
break;
case 2:
int DeleteIndex;
cout << Numeric << ")" << endl;
st[0].ShowAllRecords();
Numeric++;
st[1].ShowAllRecords();
cout << Numeric << ")" << endl;
Numeric++;
st[2].ShowAllRecords();
cout << " Enter Number of student which you want to Delete : ";
cin >> DeleteIndex;
st[DeleteIndex - 1].DeleteStudentsRecords();
break;
case 10:
ProgramEnd = false;
}
}
cin.get();
cin.get();
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment