C full program please Create a file of at least 20 student

C++ full program please - Create a file of at least 20 student records sorted by student ID. - Read student records into a vector in C++ or Java program. (For Vector, refer to Chapter 7.11) - Student records should include Student ID, Name, GPA, Student Address, and a pointer which points to (10+) test scores somewhere in the program. - Display the 20+ student records (entire record, not just ID) and associated test scores. - Use recursive binary search to search three student-IDs in the vector. These student-IDs should be generated by random function() generator. (See program 3-26, and 9-15) - Use recursive binary search to search a student-ID at the end of the vector. - Use recursive binary search to search a student-ID which is not in the vector. For each search, print the ID to be searched and the searched result with the found entire record. Your program output must show proper information to be understood well by the reader/viewer.

Solution

This is half working code with student structure and binary search on it.

#include <bits/stdc++.h>
using namespace std;

struct student {
   int id;
   string name;
   double gpa;
   string address;
   list<int> score;
   student(int id)
       : id(id),name(\"asd\"),gpa(4.0),address(\"sad\"),score()
   {}
};

bool myfunction (student i,student j) { return (i.id==j.id); }

vector<student> bin_search(vector<student> student_record, vector<int> searching_ids) {
   vector<student> found;
   for(int i=0;i<searching_ids.size();i++) {
       pair<vector<student>::iterator, vector<student>::iterator> a = equal_range(student_record.begin(), student_record.end(), student(searching_ids[i]), myfunction);
       if(a.first!=student_record.end()) {
           cout<<\"Searching for id \"<<searching_ids[i]<<\" found record \";
           //pretty_print(*a.first);
       }
   }
}

int main() {
   // do I/O part here.
   return 0;
}

C++ full program please - Create a file of at least 20 student records sorted by student ID. - Read student records into a vector in C++ or Java program. (For V

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site