Question
From your project, share an example of the program that was challenging. Describe how it works and the problems you faced. Do you still have
- From your project, share an example of the program that was challenging.
- Describe how it works and the problems you faced. Do you still have the identified problem(s)? The program excerpt that you shared can be working or still needs changes. This is a great time to get help and fix your program.
Student Management System Project
#include
using namespace std;
struct Student { string name; int studentNumber; string email; string DOB; double GPA; string subjects[5]; // Array to store the student's subjects };
bool isValidName(const string& name) { for (char c : name) { if (!isalpha(c) && !isspace(c)) { return false; } } return true; }
void addStudent(vector
do { cout << "Enter name (first Name): "; getline(cin, newStudent.name); cout << "Enter name (Last Name): "; getline(cin, newStudent.name); if (!isValidName(newStudent.name)) { cout << "Invalid name. Please use alphabetic characters and spaces only." << endl; } } while (!isValidName(newStudent.name));
cout << "Enter email: "; cin >> newStudent.email;
cout << "Enter date of birth: "; cin >> newStudent.DOB;
cout << "Enter GPA: "; cin >> newStudent.GPA; students.push_back(newStudent);
// Add subjects to the student's array for (int i = 0; i < 5; i++) { cout << "Enter subject " << i + 1 << ": "; cin >> newStudent.subjects[i]; students.push_back(newStudent);
}
cout << "Student added successfully!" << endl;
}
void deleteStudent(vector
void updateStudent(vector
void showAllStudents(const vector
int main() { vector
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored 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