project in C++

M

mazenbakry

hi...i need some help on my homework, ...i tried to compile it...but i
faced alot of errors, can anyone slove it or at least give me a general
idea..i'm so confused.

------------------------------------------------------------------------------------------

·Load a list of available courses from a text file into an array (max
4 courses).
File format can be like this:

C310211
Programming II
700
C310453
JAVA Programming
600

Where: C310211 is course ID, Programming II is course Name and 700 is
course Price.

· Display the following menu:
1: Register a student.
2: List all students (IDs & names only).
3: Display one student's details (ID, name, registered courses &
total due).
4: List all students and the courses they are registered in (no due
amount).
0: Exit.
· Maximum number of students that can be registered is 3.
· To register a student (menu option 1):
- Prompt the user to enter student's ID, first name and last name.
- Display a numbered list of available courses to the user to choose
from.
Student must register at least in 1 course and at most in 3 courses.
- Prompt user to select one of the listed courses.
- When registration is done, re-display the above menu.
· To display a student's details (menu option 3):
- Prompt for student's ID
- Display student information



Important Notes: please read
- This project is from 10 marks.
- Your program must use at least 3 classes and one inheritance.
- Do NOT use the functions get() and getline() to read input from user.
You can use
them when reading the courses file
- Your program must accept input and display output exactly as shown in
the
program run below. Same sequence is required. I am going to use
automated
input to test your program. If your program fails the automated test
you loose 2
marks.
- You must use header files as I showed you in the lab/tutorial.
- Submit your own program. Duplicates will get zero.
- You must submit your project on Dec 13, 2006.
- To submit your work, do the following:
- On your computer, create a folder has a name equal to your
student's ID +
your name.
- Put all your files (hpp and cpp) inside that folder and compile
them.
- Go into the Debug folder and delete all files except EXE or
application file.
- Use Winzip or Winrar to compress your folder and create one file
that has
the same name of your folder. Make sure you select the "Include
sub-
folders" option before you compress your folder. Otherwise, I will
get an
empty folder and you get a zero.
- Submit your compressed file through the MOODLE system.

- Below is a program run. Make sure your program runs exactly like
this:
------------------------------------------------
1: Register a student.
2: List all students.
3: display one student details.
4: List all students & registered courses.
0: Exit.

Enter your request: 1

Enter student's ID, first name and last name:
1234 yasser mohammad

Available courses:
1 30100 C++ How to Program
2 30101 JAVA How to Program
3 30102 Mathematics I/CS
4 30103 English language

Please select a course to register in (0 to finish): 1


Available courses:
1 30100 C++ How to Program
2 30101 JAVA How to Program
3 30102 Mathematics I/CS
4 30103 English language

Please select a course to register in (0 to finish): 2

Available courses:
1 30100 C++ How to Program
2 30101 JAVA How to Program
3 30102 Mathematics I/CS
4 30103 English language

Please select a course to register in (0 to finish): 0

------------------------------------------------
1: Register a student.
2: List all students.
3: display one student details.
4: List all students & registered courses.
0: Exit.

Enter your request: 1

Enter student's ID, first name and last name:
5678 sami abdullah

Available courses:
1 30100 C++ How to Program
2 30101 JAVA How to Program
3 30102 Mathematics I/CS
4 30103 English language

Please select a course to register in (0 to finish): 2

Available courses:
1 30100 C++ How to Program
2 30101 JAVA How to Program
3 30102 Mathematics I/CS
4 30103 English language

Please select a course to register in (0 to finish): 3

Available courses:
1 30100 C++ How to Program
2 30101 JAVA How to Program
3 30102 Mathematics I/CS
4 30103 English language

Please select a course to register in (0 to finish): 4

------------------------------------------------
1: Register a student.
2: List all students.
3: display one student details.
4: List all students & registered courses.
0: Exit.

Enter your request: 2

Student's id: 1234 Name: yasser mohammad
Student's id: 5678 Name: sami abdullah

------------------------------------------------
1: Register a student.
2: List all students.
3: display one student details.
4: List all students & registered courses.
0: Exit.

Enter your request: 3

enter student's id: 5678

Student's id: 5678 Name: sami abdullah
30101 JAVA How to Program 300
30102 Mathematics I/CS 280
30103 English language 250
--------------------------------------------------
Total Due: 830

--------------------------------------------------
1: Register a student.
2: List all students.
3: display one student details.
4: List all students & registered courses.
0: Exit.

Enter your request: 4

Student's id: 1234 Name: yasser mohammad
30100 C++ How to Program
30101 JAVA How to Program


Student's id: 5678 Name: sami abdullah
30101 JAVA How to Program
30102 Mathematics I/CS
30103 English language

------------------------------------------------
1: Register a student.
2: List all students.
3: display one student details.
4: List all students & registered courses.
0: Exit.

Enter your request: 0
 
S

Salt_Peter

(e-mail address removed) wrote:

· Display the following menu:
1: Register a student.
2: List all students (IDs & names only).
3: Display one student's details (ID, name, registered courses &
total due).
4: List all students and the courses they are registered in (no due
amount).
0: Exit.
· Maximum number of students that can be registered is 3.
· To register a student (menu option 1):
- Prompt the user to enter student's ID, first name and last name.
- Display a numbered list of available courses to the user to choose
from.
Student must register at least in 1 course and at most in 3 courses.
- Prompt user to select one of the listed courses.
- When registration is done, re-display the above menu.
· To display a student's details (menu option 3):
- Prompt for student's ID
- Display student information



Important Notes: please read
- This project is from 10 marks.
- Your program must use at least 3 classes and one inheritance.
- Do NOT use the functions get() and getline() to read input from user.
You can use
them when reading the courses file
- Your program must accept input and display output exactly as shown in
the
program run below. Same sequence is required. I am going to use
automated
input to test your program. If your program fails the automated test
you loose 2
marks.

<snip>

Thats nice, what have you done so far?
Surely, you've at least attempted to store a Student, right?
How did you that?
 
R

rossum

hi...i need some help on my homework, ...i tried to compile it...but i
faced alot of errors, can anyone slove it or at least give me a general
idea..i'm so confused.
Don't try to write the whole thing in one go. Write a small part,
test that part and then move on to the next part.

[snip]
· Display the following menu:
1: Register a student.
2: List all students (IDs & names only).
3: Display one student's details (ID, name, registered courses &
total due).
4: List all students and the courses they are registered in (no due
amount).
0: Exit.

I suggest that you start here. Write something to display this menu
on the screen. At this stage just use stubs for the functions called
from your menu. By "stub" I mean something like:

void register_student() {
std::cout << "Running register_student()\n";
}

Just enough to compile OK and let you follow what your program is
doing.

Test your menu and make sure that it works. Test that each option is
calling the right stub. Test that nonsense options like "X" or "8" do
not crash the menu.

Now expand one stub into the full function, creating other stubs as
needed. Test the new function. Only proceed if all the tests are OK.
Regular testing is important. That way you only have to look for
errors n a small part of the whole program. When the tests all run
OK, expand the next stub. Test that expanded function and so on.

When you have no stubs left to expand and all tests have been passed
OK, your program is finished.

If you have already written more than the menu and stubs then save
what you have done and make a cut-down copy. It is much easier to
find an error in 100 lines of code, than to find an error in 500 lines
of code. You can copy back in parts of your previous work as needed.

rossum
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,521
Members
44,995
Latest member
PinupduzSap

Latest Threads

Top