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

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




Structure of students in C++

 
Reply to this topicStart new topic

Structure of students in C++, this creates C++ program for enrolling students

charlesnet09
post 15 Jul, 2008 - 04:02 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

red_4900
post 15 Jul, 2008 - 06:17 PM
Post #2


Code Dreamers

****
Joined: 22 Feb, 2008
Posts: 792



Thanked 10 times
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.
smile.gif

This post has been edited by red_4900: 15 Jul, 2008 - 06:18 PM
User is offlineProfile CardPM

Go to the top of the page

charlesnet09
post 17 Jul, 2008 - 01:19 AM
Post #3


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);



User is offlineProfile CardPM

Go to the top of the page

lanec42
post 17 Jul, 2008 - 01:22 AM
Post #4


D.I.C Head

**
Joined: 25 Mar, 2008
Posts: 136


My Contributions


OK, so....
What is your question??
User is offlineProfile CardPM

Go to the top of the page

charlesnet09
post 17 Jul, 2008 - 06:24 AM
Post #5


New D.I.C Head

*
Joined: 15 Jul, 2008
Posts: 5

can u help me run my codes.. pls
User is offlineProfile CardPM

Go to the top of the page

Amadeus
post 17 Jul, 2008 - 07:09 AM
Post #6


g++ -o drink whiskey.cpp

Group Icon
Joined: 12 Jul, 2002
Posts: 12,176



Thanked 33 times

Dream Kudos: 25
My Contributions


All that has been provided is a template that you were given as part of the assignment. Have you made an effort to program the assignment? If so, can you please provide the code you have written, along with any error messages encountered?
User is offlineProfile CardPM

Go to the top of the page

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

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