Question
C++ Assignment on Search and Sort for Chapter 8 Problem: Modify the student grade problem to include the following: Write a Search function to search
C++ Assignment on Search and Sort for Chapter 8 Problem: Modify the student grade problem to include the following:
Write a Search function to search by student score Write a Search function to search by student last name Write a Sort function to sort the list by student score Write a Sort function to sort the list by student last name Write a menu function that lets user to choose any action he/she want to do.
Make sure your program has option to test the program as many times as the user wants.
Student Grade Problem below:
#include
using namespace std;
// Function to calculate grade char calcGrade(float n) { if (n>=9) return 'A'; if (n>=8 && n<9) return 'B'; if (n>=7 && n<8) return 'C'; if (n>=6 && n<7) return 'D'; else return 'F'; }
int main() { // A structure variable struct student { string name; float test1, test2, lab, quiz, final, total; char grade; };
// N is the number of students int n; cout << "Enter the number of students "; cin >> n; student s[n];
// taking the input for all the students for (int i = 0;i
// printing the output cout << fixed << setprecision(2); cout << left << setw(30) << " Student Name" << setw(8) << "Test1" << setw(8) << "Test2" << setw(8) << "Lab" << setw(8) << "Quiz" << setw(8) << "Final" << setw(8) << "Total" << setw(8) << "Grade"; cout << endl << left << setw(30) << "============" << setw(8) << "=====" << setw(8) << "=====" << setw(8) << "===" << setw(8) << "====" << setw(8) << "=====" << setw(8) << "=====" << setw(8) << "=====" << endl; for (int i = 0;i return 0; }
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access with AI-Powered Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started