Professional Documents
Culture Documents
Itc Project 0255
Itc Project 0255
#include <cstdlib>
int curr = 50;
int size = 100;
int choice;
while (true)
{
cout << "==============================" << endl;
cout << "==============================" << endl;
cout << " Student Records " << endl;
cout << "==============================" << endl;
system("cls");
if (choice == 0 || choice == 0)
{
break;
}
else if (choice == 1)
{
temp = classno[j];
classno[j] = classno[j + 1];
classno[j + 1] = temp;
temp = midmarks[j];
midmarks[j] = midmarks[j + 1];
midmarks[j + 1] = temp;
temp = finalmarks[j];
finalmarks[j] = finalmarks[j + 1];
finalmarks[j + 1] = temp;
temp = classno[j];
classno[j] = classno[j + 1];
classno[j + 1] = temp;
temp = midmarks[j];
midmarks[j] = midmarks[j + 1];
midmarks[j + 1] = temp;
temp = finalmarks[j];
finalmarks[j] = finalmarks[j + 1];
finalmarks[j + 1] = temp;
char tempGrade = grade[j];
grade[j] = grade[j + 1];
grade[j + 1] = tempGrade;
}
}
}
temp = classno[j];
classno[j] = classno[j + 1];
classno[j + 1] = temp;
temp = finalmarks[j];
finalmarks[j] = finalmarks[j + 1];
finalmarks[j + 1] = temp;
temp = classno[j];
classno[j] = classno[j + 1];
classno[j + 1] = temp;
temp = finalmarks[j];
finalmarks[j] = finalmarks[j + 1];
finalmarks[j + 1] = temp;
temp = classno[j];
classno[j] = classno[j + 1];
classno[j + 1] = temp;
else if (choice == 6)
{
temp = classno[j];
classno[j] = classno[j + 1];
classno[j + 1] = temp;
temp = finalmarks[j];
finalmarks[j] = finalmarks[j + 1];
finalmarks[j + 1] = temp;
else if (choice == 7)
{
temp = classno[j];
classno[j] = classno[j + 1];
classno[j + 1] = temp;
temp = finalmarks[j];
finalmarks[j] = finalmarks[j + 1];
finalmarks[j + 1] = temp;
else if (choice == 8)
{
for (int i = 0; i < curr - 1; i++)
{
for (int j = 0; j < curr - i - 1; j++)
{
if (grade[j] < grade[j + 1])
{
int temp = rollno[j];
rollno[j] = rollno[j + 1];
rollno[j + 1] = temp;
temp = classno[j];
classno[j] = classno[j + 1];
classno[j + 1] = temp;
temp = finalmarks[j];
finalmarks[j] = finalmarks[j + 1];
finalmarks[j + 1] = temp;
if (rollExists)
{
cout << "Error: Roll number already exists. Please choose a
unique roll number.\n";
}
else
{
rollno[curr] = newRoll;
cout << "Enter the new student's class number: ";
cin >> classno[curr];
do
{
cout << "Enter the new student's midterm marks (maximum
50): ";
cin >> midmarks[curr];
if (midmarks[curr] > 50)
{
cout << "Error: Midterm marks cannot exceed 50. Please
enter a valid value.\n";
}
} while (midmarks[curr] > 50);
do
{
cout << "Enter the new student's final marks (maximum 100):
";
cin >> finalmarks[curr];
if (finalmarks[curr] > 100)
{
cout << "Error: Final marks cannot exceed 100. Please
enter a valid value.\n";
}
} while (finalmarks[curr] > 100);
if (deleteIndex != -1)
{
for (int i = deleteIndex; i < curr - 1; i++)
{
rollno[i] = rollno[i + 1];
classno[i] = classno[i + 1];
midmarks[i] = midmarks[i + 1];
finalmarks[i] = finalmarks[i + 1];
grade[i] = grade[i + 1];
}
curr--;
cout << "Student with roll number " << deleteRoll << " deleted
successfully.\n";
}
else
{
cout << "Roll number not found. No student deleted.\n";
}
}
else if (choice == 11)
{
float threshold;
cout << "Enter the threshold for final exam marks: ";
cin >> threshold;
int copiedRollno[100] = {0};
int copiedClassno[100] = {0};
float copiedMidmarks[100] = {0};
float copiedFinalmarks[100] = {0};
char copiedGrade[100] = {0};
temp = copiedClassno[j];
copiedClassno[j] = copiedClassno[j + 1];
copiedClassno[j + 1] = temp;
temp = copiedFinalmarks[j];
copiedFinalmarks[j] = copiedFinalmarks[j + 1];
copiedFinalmarks[j + 1] = temp;
cout << "\nRecords of Students with Final Exam Marks > " << threshold
<< " (Descending Order):\n";
for (int i = 0; i < curr; i++)
{
if (copiedFinalmarks[i] > 0)
{
cout << "Student " << i + 1 << " - Class: " << copiedClassno[i]
<< ", Roll Number: " << copiedRollno[i]
<< ", Midterm Marks: " << copiedMidmarks[i]
<< ", Final Marks: " << copiedFinalmarks[i]
<< ", Grade: " << copiedGrade[i] << "\n";
}
}
}
float threshold;
cout << "Enter the threshold for final exam marks: ";
cin >> threshold;
int copiedRollno[100] = {0};
int copiedClassno[100] = {0};
float copiedMidmarks[100] = {0};
float copiedFinalmarks[100] = {0};
char copiedGrade[100] = {0};
temp = copiedClassno[j];
copiedClassno[j] = copiedClassno[j + 1];
copiedClassno[j + 1] = temp;
temp = copiedFinalmarks[j];
copiedFinalmarks[j] = copiedFinalmarks[j + 1];
copiedFinalmarks[j + 1] = temp;
cout << "\nRecords of Students with Final Exam Marks > " << threshold
<< " (Ascending Order):\n";
for (int i = 0; i < curr; i++)
{
if (copiedFinalmarks[i] > 0)
{
cout << "Student " << i + 1 << " - Class: " << copiedClassno[i]
<< ", Roll Number: " << copiedRollno[i]
<< ", Midterm Marks: " << copiedMidmarks[i]
<< ", Final Marks: " << copiedFinalmarks[i]
<< ", Grade: " << copiedGrade[i] << "\n";
}
}
}
float threshold;
cout << "Enter the threshold for final exam marks: ";
cin >> threshold;
int copiedRollno[100] = {0};
int copiedClassno[100] = {0};
float copiedMidmarks[100] = {0};
float copiedFinalmarks[100] = {0};
char copiedGrade[100] = {0};
temp = copiedClassno[j];
copiedClassno[j] = copiedClassno[j + 1];
copiedClassno[j + 1] = temp;
temp = copiedFinalmarks[j];
copiedFinalmarks[j] = copiedFinalmarks[j + 1];
copiedFinalmarks[j + 1] = temp;
cout << "\nRecords of Students with Final Exam Marks <= " << threshold
<< " (Descending Order):\n";
for (int i = 0; i < curr; i++)
{
if (copiedFinalmarks[i] > 0)
{
cout << "Student " << i + 1 << " - Class: " << copiedClassno[i]
<< ", Roll Number: " << copiedRollno[i]
<< ", Midterm Marks: " << copiedMidmarks[i]
<< ", Final Marks: " << copiedFinalmarks[i]
<< ", Grade: " << copiedGrade[i] << "\n";
}
}
}
temp = copiedClassno[j];
copiedClassno[j] = copiedClassno[j + 1];
copiedClassno[j + 1] = temp;
temp = copiedFinalmarks[j];
copiedFinalmarks[j] = copiedFinalmarks[j + 1];
copiedFinalmarks[j + 1] = temp;
cout << "\nRecords of Students with Final Exam Marks <= " << threshold
<< " (Ascending Order):\n";
for (int i = 0; i < curr; i++)
{
if (copiedFinalmarks[i] > 0)
{
cout << "Student " << i + 1 << " - Class: " << copiedClassno[i]
<< ", Roll Number: " << copiedRollno[i]
<< ", Midterm Marks: " << copiedMidmarks[i]
<< ", Final Marks: " << copiedFinalmarks[i]
<< ", Grade: " << copiedGrade[i] << "\n";
}
}
}
temp = copiedClassno[j];
copiedClassno[j] = copiedClassno[j + 1];
copiedClassno[j + 1] = temp;
temp = copiedFinalmarks[j];
copiedFinalmarks[j] = copiedFinalmarks[j + 1];
copiedFinalmarks[j + 1] = temp;
cout << "\nRecords of Students with Grade > " << threshold << "
(Descending Order):\n";
for (int i = 0; i < curr; i++)
{
if (copiedFinalmarks[i] > 0)
{
cout << "Student " << i + 1 << " - Class: " << copiedClassno[i]
<< ", Roll Number: " << copiedRollno[i]
<< ", Midterm Marks: " << copiedMidmarks[i]
<< ", Final Marks: " << copiedFinalmarks[i]
<< ", Grade: " << copiedGrade[i] << "\n";
}
}
}
else if (choice == 16)
{
char threshold;
cout << "Enter the threshold for the grade: ";
cin >> threshold;
int copiedRollno[100] = {0};
int copiedClassno[100] = {0};
float copiedMidmarks[100] = {0};
float copiedFinalmarks[100] = {0};
char copiedGrade[100] = {0};
temp = copiedClassno[j];
copiedClassno[j] = copiedClassno[j + 1];
copiedClassno[j + 1] = temp;
cout << "\nRecords of Students with Grade > " << threshold << "
(Ascending Order):\n";
for (int i = 0; i < curr; i++)
{
if (copiedFinalmarks[i] > 0)
{
cout << "Student " << i + 1 << " - Class: " << copiedClassno[i]
<< ", Roll Number: " << copiedRollno[i]
<< ", Midterm Marks: " << copiedMidmarks[i]
<< ", Final Marks: " << copiedFinalmarks[i]
<< ", Grade: " << copiedGrade[i] << "\n";
}
}
}
temp = copiedFinalmarks[j];
copiedFinalmarks[j] = copiedFinalmarks[j + 1];
copiedFinalmarks[j + 1] = temp;
cout << "\nRecords of Students with Grade <= " << threshold << "
(Descending Order):\n";
for (int i = 0; i < curr; i++)
{
if (copiedFinalmarks[i] > 0)
{
cout << "Student " << i + 1 << " - Class: " << copiedClassno[i]
<< ", Roll Number: " << copiedRollno[i]
<< ", Midterm Marks: " << copiedMidmarks[i]
<< ", Final Marks: " << copiedFinalmarks[i]
<< ", Grade: " << copiedGrade[i] << "\n";
}
}
}
else if (choice == 18)
{
char threshold;
cout << "Enter the threshold for the grade: ";
cin >> threshold;
int copiedRollno[100] = {0};
int copiedClassno[100] = {0};
float copiedMidmarks[100] = {0};
float copiedFinalmarks[100] = {0};
char copiedGrade[100] = {0};
temp = copiedClassno[j];
copiedClassno[j] = copiedClassno[j + 1];
copiedClassno[j + 1] = temp;
temp = copiedFinalmarks[j];
copiedFinalmarks[j] = copiedFinalmarks[j + 1];
copiedFinalmarks[j + 1] = temp;
cout << "\nRecords of Students with Grade <= " << threshold << "
(Ascending Order):\n";
for (int i = 0; i < curr; i++)
{
if (copiedFinalmarks[i] > 0)
{
cout << "Student " << i + 1 << " - Class: " << copiedClassno[i]
<< ", Roll Number: " << copiedRollno[i]
<< ", Midterm Marks: " << copiedMidmarks[i]
<< ", Final Marks: " << copiedFinalmarks[i]
<< ", Grade: " << copiedGrade[i] << "\n";
}
}
}
else
{
cout << "Invalid choice. Please try again.\n";
}
}
cout << "Thank you for using \n";
return 0;
}