Question: Program a c++ code about using the brute force exhaustive search algorithmic techniques and do time and space complexity analysis Topic: Student course and marks
Program a c++ code about using the brute force\ exhaustive search algorithmic techniques and do time and space complexity analysis
Topic: Student course and marks
We will discuss the problem of course and marks in this project. First, we will search the student's information. Next, we will search the titles of the materials the student registered for and his grades there. Finally, we will take all of the grades and do mathematical operations to determine the student's overall grades.
The code:
#include
#include
struct Student {
std::string name;
std::vector
std::vector
};
std::vector
void search() {
std::string searchName;
std::cout << "Enter student name: ";
std::cin >> searchName;
for (const auto& student : students) {
if (student.name == searchName) {
std::cout << "Student found:" << std::endl;
std::cout << "Name: " << student.name << std::endl;
std::cout << "Courses: ";
for (const auto& course : student.courses) {
std::cout << course << " ";
}
std::cout << std::endl;
std::cout << "Grades: ";
for (const auto& grade : student.grades) {
std::cout << grade << " ";
}
std::cout << std::endl;
double overall_grade = 0;
for (const auto& grade : student.grades) {
overall_grade += grade;
}
overall_grade /= student.grades.size();
std::cout << "Overall grade: " << overall_grade << std::endl;
return;
}
}
std::cout << "Student not found." << std::endl;
}
int main() {
// populate the students vector with sample data
students.push_back({ "Alice", {"Math", "Physics", "Chemistry"}, {90, 80, 85} });
students.push_back({ "Bob", {"English", "History", "Art"}, {70, 75, 80} });
students.push_back({ "Charlie", {"Computer Science", "Electronics", "Biology"}, {65, 70, 75} });
search();
}
The output:
This code defines a Student struct that contains the student's name, a vector of courses, and a vector of grades. It also contains a global vector of students that is populated with some sample data. The search function prompts the user for a student name and then uses a for-loop to iterate through the vector of students.
Explanation:
For each student, it compares the student's name to the search name. If there is a match, the function prints out the student's name, courses, and grades. It also prints the overall grade of the student and return otherwise it print student not found.
can you help me to do the following requirements:please
Your project should create a students' courses and marks database and should have the following functionalities:
1. Sort according to the student's names and Ids
2. Search the students' database by course id for the student list and corresponding marks
3. Search by student's marks
Use a suitable data structure such as, BST, heap or others to store the database and perform the above operations using appropriate algorithms
In the first phase you have to submit a hard copy including the following components: A mathematical model for the solution (10 points) Algorithm that you have designed (15 points) Analysis of the algorithm (10 points) Determine the time and space complexity (establishing the order of growth) of the algorithm (5 points)
For mathematical modeling of the problem, please check a simple example below
https://www.mathsisfun.com/algebra/mathematical-models.html
Please, the person who will take my assignment fulfill all the required and not part of it. This project is very important because I do not want to take a bad grade. He must fulfill all the requirements of the doctor. The mathematical model and write and analyze the required algorithm and determine the time and space complexity (establishing the order of growth) of the algorithm .
I hope a professional person will take my task and complete it to the fullest extent. Last time, I did not benefit from the answer.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
