Welcome to Dream.In.Code
Getting C++ Help is Easy!

Join 132,605 C++ Programmers for FREE! Get instant access to thousands of C++ experts, tutorials, code snippets, and more! There are 915 people online right now. Registration is fast and FREE... Join Now!




simple student database program

 
Reply to this topicStart new topic

simple student database program, this creates C++ program for enrolling students

charlesnet09
post 15 Jul, 2008 - 03:57 PM
Post #1


New D.I.C Head

*
Joined: 15 Jul, 2008
Posts: 5

Create a simple student database program. You are to have the following structures:
struct Student{
char id[10];
char fname[30];
char mname[30];
char lname[30];
char course[50];
int age;
int year;
};
struct subject{
Student students[40];
char name[20];
int size;
};
The first will represent a student's record. The second a particular class.
You are going to create just one class/subject. Prompt the user the following menu:
Menu:
1. Enroll
2. Drop
3. Sort by ID
4. Sort by Name
5. Display by Year
6. Display by Name
7. Display by ID
8. Exit

All these items, except of course for Exit, must be implemented using a function. You must also include a function that searches an ID, a name. Display functions should also be implemented, one for a particular student, and another for the entire class/subject.

For enroll, you must first check if the student/ID number already exists in the class. If that is the case, report a message that the student is already enrolled in the class. This is of course a separate check from the class size.

For Drop, check first if the student exists in the class. Report a no such student message if otherwise.
User is offlineProfile CardPM

Go to the top of the page

jjsaw5
post 15 Jul, 2008 - 06:20 PM
Post #2


I vill break you

Group Icon
Joined: 4 Jan, 2008
Posts: 1,364



Thanked 6 times

Dream Kudos: 125

Expert In: HTML, CSS, Database,

My Contributions


Dream.In.Code has a policy by which we prefer to see a good faith effort on your part before providing source code for homework assignments. Please post the code you have written in an effort to resolve the problem, and our members would be happy to provide some guidance. Be sure to include a description of any errors you are encountering as well.

Please post like this:

Thank you for helping us helping you.
User is offlineProfile CardPM

Go to the top of the page

Jayman
post 15 Jul, 2008 - 06:28 PM
Post #3


Student of Life

Group Icon
Joined: 26 Dec, 2005
Posts: 6,839



Thanked 38 times

Dream Kudos: 500

Expert In: C#, VB.NET, Java

My Contributions


Modified Title to be more descriptive.
User is offlineProfile CardPM

Go to the top of the page

charlesnet09
post 17 Jul, 2008 - 01:16 AM
Post #4


New D.I.C Head

*
Joined: 15 Jul, 2008
Posts: 5

CODE
#include <iostream.h>
#include <conio.h>
#include <string.h>

struct Student{
char id[10];
char fname[30];
char mname[30];
char lname[30];
char course[50];
int age;
int year;
};

struct subject{
Student students[40];
char name[20];
int size;
};



bool enrol(subject&,Student);
bool drop(subject&,Student);
void sortID(subject&);
void sortName(subject&);
void displayYear(subject&,int);
void displayName(subject&,char[]);
void displayID(subject&,char[]);
bool searchID(subject&,char[]);
bool searchName(subject&,char[]);

void display(Student);
void display(subject);




can someone help me run this code.. pls... that's only thing i knew.. im sorry because im just a 1st year student...
User is offlineProfile CardPM

Go to the top of the page

Reply to this topicStart new topic
Time is now: 11/23/08 02:27AM

Live C++ Help!

C++ Tutorials

Reference Sheets

C++ Snippets

Bye Bye Ads

Free DIC T-Shirt

T-Shirt Example

Related Sites

Monthly Drawing

Thumb Drive

Partners

Top Contributors

Top 10 Kudos This Month