Database design. Write a simple user manual for a college student database. Inst
ID: 3829418 • Letter: D
Question
Database design. Write a simple user manual for a college student database.
Instructions given: The database specifications are: list all college student information(Firstname, lastname,student id,address,etc) and list all courses in students curriculum( Course id, course name, credit hours.etc.) Reports:Student Information and Students curriculum. Add any additional requirements that you feel the database may need.
Research your curriculum and design a database lists:
Entitities:
Student Data
Curriculum courses.
Reports:
Student Data
Courses required
Courses completed
Courses Remaining
Explanation / Answer
#include <string>
#include <fstream>
#include <iostream>
using namespace std;
class student
{
public:
student()
{
name = '0';
s_id = '0';
major = '0';
}
student(string n, string m, string j);
friend ostream & operator <<(ostream &os, const student& stu)
{
os << "Name: " << stu.name << " " << "Student ID: " << stu.s_id;
return os;
}
string name;
string s_id;
string major;
};
student::student(string n, string m, string j)
{
name = n;
s_id = m;
major = j;
}
int main(void)
{
cout << "Please enter the number of students in the database: ";
int size;
cin >> size;
size = size+1;
student *a;
a = new student[size];
int i = 1;
for(i=1;i<size;i++)
{
cout << "Enter name, student ID, and major... (follow each input with the 'enter' key until new prompt is seen):" << endl;
string sname;
string snumber;
string smajor;
cin >> sname >> snumber >> smajor;
student test(sname, snumber, smajor);
a[i] = test;
}
cout << "Would you like to edit any data? (yes or no): ";
string yes = "yes";
string te;
cin >> te;
string no = "no";
if(te == yes)
{
cout << endl << "Would you like to search by the student's name instead of the ID? (yes or no): ";
string fat;
cin >> fat;
if(fat == yes)
{
string ttname;
cout << endl << "What is the student's name?: " << endl;
cin >> ttname;
int j = 1;
for(j=1;j<size;j++)
{
student temp2;
temp2 = a[j];
if(temp2.name == ttname)
{
cout << "You want to edit?: " << endl << temp2 << endl;
cout << "What is the new major?: ";
string neww;
cin >> neww;
temp2.major = neww;
a[j] = temp2;
cout << "The new file looks like..." << endl;
cout << temp2;
}
}
}
if(fat == no)
{
cout << "What is the student's ID that you would like to edit?: ";
int tem;
cin >> tem;
cout << "You would like to edit: " << endl << a[tem];
cout << endl;
cout << "What is the new major?: ";
string newm;
cin >> newm;
student tempp;
tempp = a[tem];
tempp.major = newm;
a[tem] = tempp;
cout << "The new file looks like..." << endl;
cout << tempp;
}
}
cout << endl << "Would you like to show the details of a student? (yes or no): ";
string response;
cin >> response;
if(response == yes)
{
string tempname;
cout << endl << "What is their name: " << endl;
cin >> tempname;
int j = 1;
for(j = 1;j<size;j++)
{
student temp1;
temp1 = a[j];
if(temp1.name == tempname)
{
cout<<temp1<<endl;
}
}
}
cout << endl << "Would you like to display the entire database (yes or no): ";
string testing;
cin >> testing;
if(testing == yes)
{
int k = 0;
for(k = 1;k<size;k++)
{
cout << k << ".)" << endl << a[k] << endl;
}
}
delete a;
return 0;
}
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.