Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

(C++ Please help) Currently using visual studio, and my program will not work Pr

ID: 3709627 • Letter: #

Question

(C++ Please help) Currently using visual studio, and my program will not work

Program Specification

You are to create a student record program. It should track a student's ID number, first name, last name, street, city, state, zip, and GPA.

Your program should display a menu like the following:

A) Enter a new student

B) Display the students in the system

C) Remove a student

D) Exit

Your program should start with an empty array. Each time a new student is added you should dynamically allocate a new array that is one bigger than the old array, copy the data into the new array, and delete the old array. If the user chooses option B display the students in a well formatted table. You need to display, at a minimum, the users ID number, first name, and last name. To remove a student first display the table of students and ask for the student's ID number. Next create a new array one size smaller. Copy the data from one array to the other skipping the removed data. After a user finishes a menu option return them to the main menu until they choose to exit. You must use a minimum of 5 functions for this project but you are free to choose where and how to use them.

Input Validation You must validate input within reason. Determine for yourself what is acceptable for menus, GPA's, etc.

Explanation / Answer

//code to copy

#include<string>
#include<iostream>
using namespace std;
struct Student
{
string studentId;
string firstName;
string lastName;
string street;
string city;
string state;
string zip;
double GPA;

};

void printmenu()
{
cout<<"A)Enter a new Student"<<endl;
cout<<"B) Display the students in the system"<<endl;
cout<<"C) Remove a student"<<endl;
cout<<"D) Exit"<<endl;
}
struct Student takeStudentDetail()
{
struct Student temp_student;
cout<<"Enter Student Id:"<<endl;
cin>>temp_student.studentId;

cout<<"Enter Student First Name"<<endl;
cin>>temp_student.firstName;

cout<<"Enter Student Last Name"<<endl;
cin>>temp_student.lastName;
cout<<"Enter Street:"<<endl;
cin>>temp_student.street;
cout<<"Enter City:"<<endl;
cin>>temp_student.city;
cout<<"Enter State:"<<endl;
cin>>temp_student.state;
cout<<"Enter Zip:"<<endl;
cin>>temp_student.zip;
cout<<"Enter GPA:"<<endl;
cin>>temp_student.GPA;

return temp_student;

}
void printStudentData(struct Student student_data[], int no_of_student )
{
cout<<"ID FirstName: LastName< Strret City State Zip GPA"<<endl;
for(int i=0;i<no_of_student;i++)
{
cout<<student_data[i].studentId<<" "<<student_data[i].firstName<<" "<<student_data[i].lastName;
cout<<" "<<student_data[i].street<<" "<<student_data[i].city<<" "<<student_data[i].state;
cout<<" "<<student_data[i].zip<<" "<<student_data[i].GPA<<endl;
}
}


int main()
{
struct Student students[10],*dummy;
int currentStudent=0;
char choise;
while(true)
{
printmenu();
cin>>choise;

if(choise=='A'||choise=='a')
{
//dummy=new Student[currentStudent];
//dummy=students;
//delete students;
//students=new Student[currentStudent+1];
//students=dummy;
students[currentStudent]=takeStudentDetail();
currentStudent++;
// delete dummy;

}
else if(choise=='B'||choise=='b')
{
printStudentData(students,currentStudent);
}
else if(choise=='C'||choise=='c')
{
string del_id;
printStudentData(students,currentStudent);
cout<<"Enter Student id to Delete:"<<endl;
cin>>del_id;
int i;
for(i=0;i<currentStudent;i++)
{
if(students[i].studentId==del_id)
{
break;
}
}
for(;i<currentStudent-1;i++)
{
students[i]=students[i+1];
}
cout<<"Successfully Deleted."<<endl;

//students=removeStudent(students,del_id,currentStudent);
currentStudent--;
}

else if(choise=='D'||choise=='d')
{
break;
}
}
cout<<students[0].firstName<<endl;

return 0;

}