Question: Re-write the below program However, you must use an array of structures. Additionally, your program lets the user display student information for students that have

Re-write the below program However, you must use an array of structures. Additionally, your program lets the user display student information for students that have obtained marks within a certain range. For example, display all students information that obtained marks above a value provided by the user.

#include #include using namespace std;

/* Write a program that keeps track of student progress in a course. In particular, your program prompts the user to enter the number of students in the course. (DONE) Then, your program prompts the user to enter the first and last names of each student and marks obtained.(DONE) Your program displays the first names, last names, and the marks obtained for the entire class. The display should be sorted by marks obtained. You must not use any structures. (BUBBLE SORT.DONE) You must not use vector template class. You must not use array template class. Your program must use string class and must use new and delete */

int main() { int noOfStudents = 1; cout << "Welcome to Student Management System" << endl; cout << "====================================" << endl; cout << "Enter number of students in the course : " ; cin >> noOfStudents ; string* firstName = new string[noOfStudents]; string* lastName = new string[noOfStudents]; //Integer variable for marks using new keyword int* marks = new int[noOfStudents]; string temp1; string temp2; int temp3; for(int i=0;i> firstName[i] ; cout << "Enter Last Name : " ; cin >> lastName[i] ; cout << "Enter Marks : "; cin >> marks[i] ; cout<<" "; while(marks[i]<0 || marks[i]>100) { cout << "Please enter marks between 0 to 100"<< endl; cout << "Enter Marks : "; cin >> marks[i]; } } for(int i=0;imarks[j]) { temp1 = firstName[i]; temp2 = lastName[i]; temp3 = marks[i]; marks[i] = marks[j]; firstName[i]=firstName[j]; lastName[i] = lastName[j]; marks[j] = temp3; firstName[j] = temp1; lastName[j] = temp2; } } } //Displaying the output cout << " =============Details==============="<< endl; cout << "Full Name \tmarks" << endl; cout << "============================"<< endl; for(int i=0;i

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!