![]() |
|
#1
|
|||
|
|||
A class problem, very confused!!I just start to learn class ,but now i am facing a question which is extremely hard for me.
The question is You are required to complete a C++ program that reads a specific file with data about students who have completed 3 assignments and the final exam in a unit, and displays top students. Input: A text file containing students’ information. The information of each student is given in a line with the following format, which includes the student ID and 4 scores of assignment 1, assignment 2, assignment 3 and the final exam in order. <student ID> <score of assignment 1> <score of assignment 2> <score of assignment 3> <score of final exam> NOTE: 1. The score of each assignment is in the scope of 0~12 (inclusive). The sum of assignments is in the scope of 0~30(inclusive). E.g., if the sum of 3 assignments is 31 (say 11 + 10 + 10), it is reduced to 30. If the sum is 25 (i.e. no more than 30), it would not be changed. 2. The score of final exam is in the scope of 0~180 (inclusive). To calculate the final total score (in the scope of 0~100 (inclusive)), the exam score should be scaled down to 70%. E.g., the score of 180 is scaled down to 70, and 90 is scaled down to 35. The program should open once a file with entered filename and read data from it. Output: The program should display the id and the total score of top students with the best 5 total scores. This program has two header files and 3 .cpp files, i have done some of them, but look like many of them are incorrect and some syntaxs i can't understand.(especially how to link class member function with my main() program ) I am posting what i have already done there ,hope someone give me some ideas to solve this problem. There are two header files: CPP / C++ / C Code:
CPP / C++ / C Code:
There 3 .cpp files CPP / C++ / C Code:
CPP / C++ / C Code:
Last edited by LuciWiz : 16-Sep-2007 at 08:04.
Reason: Please insert your C/C++ code between [cpp] & [/cpp] tags
|
|||
|
#2
|
|||
|
|||
Re: A class problem, very confused!!CPP / C++ / C Code:
Last edited by LuciWiz : 16-Sep-2007 at 08:05.
Reason: Please insert your C/C++ code between [cpp] & [/cpp] tags
|
|
#3
|
|||
|
|||
Re: A class problem, very confused!!I remember seeing something like this not long ago.
Posting basically the same assignment multiple times doesn't get you any better answers. And posting the same assignment AND being as vague as the previous time REALLY doesn't help much. Quote:
1. "Looks like many of them are incorrect?" Care to shed some light into what you think is incorrect? And what should that part do that it's not doing. 2. What syntax parts don't you understand? 3. What do you mean by linking class member functions with your main()? If you're using some kind of an IDE and create a project in an IDE, the IDE takes care of linking automatically. If you're not using an IDE, you must link the files manually. (But I assume you know that, since if you must link manually, you are probably also compiling "manually" etc.) Maybe you mean something else? 4. I have some ideas, yes. But I'm expecting some ideas from you too. CPP / C++ / C Code:
CPP / C++ / C Code:
CPP / C++ / C Code:
CPP / C++ / C Code:
One more advice: Testing. I'm 88% (or more) percent sure you have done no testing at all while writing this stuff. |
Recent GIDBlog
Problems with the Navy (Chiefs) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Classes and allocating memory | BlueFireCO. | C++ Forum | 13 | 26-Jul-2007 21:31 |
| Hard drive/CPU Diagnoses Issues | binarybug | Computer Hardware Forum | 1 | 22-Jan-2007 20:23 |
| Box Class, need help again :( | TransformedBG | C++ Forum | 7 | 13-Nov-2006 16:11 |
| Problem with Overloaded Constructors and Class within Class | jdbrine | C++ Forum | 2 | 10-Jul-2006 23:14 |
| a tester class and then some. | postage | Java Forum | 1 | 06-May-2006 16:48 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The