![]() |
|
#1
|
|||
|
|||
Student ID/Grades program help...OK So i have to do this program for school but im stuck...
here is the program description... Objective: This project will require you to put use the basic concepts of C programming covered in class. It will use control structures, logical operators, functions, array data structure and pointers in C. Description: Create a 10(rows)x5(columns) array to store student grades in four courses. The first column should contain the student_id ranging from 1001 to 1010. The remaining four columns will represent grades in Course1, Course2, Course3 and Course4. The values for this column will range from 0-100. Do not accept values for this array from the user. Define the values for the array in your program with numbers that fall within the specified range. The program must be designed to display and handle the following menu options: (a) Print the average of all courses for a specific student. Hint: In order to do this you will accept the student ID from the user and print the avg grade for that student. (b) Print the average of all students for a specific course. Hint: In order to do this you will accept the Course Number from the user and print the avg grade for that course. (c) Print the Grade in letter for a specific student and specific course. Hint: Accepts the StudentID and Course Number and convert the numerical grade for that course into a letter grade between A and F. Use the following grading system: GRADE MARKS A 100 – 91 B 90 - 81 C 80 – 71 D 70 – 61 F <= 60 (d) Modify the grades for a specific student in a specific course. Hint: Accept the StudentID , Course Number and new grade for that course and change the value in the array. (e) Print all the students and grades for each student in a tabular format with all data right aligned. Each menu option must be defined as a function. Use a switch-case structure to process the option input and invoke the corresponding function. The program must also accept appropriate input for the option and pass it as an argument to the appropriate function. The function must take care of all the printing needs for that menu option. For menu option (d), pointers must be used to modify the grade of the student in the specified course. The numerical grade must be accepted from the user and also a check must be done to ensure that the value is between 1- 100. If it is not, the user must be prompted to re-enter a new value until it fits the requirement. For menu option (e), use proper format spefications in printf() to print a table and all values in the table to be right aligned as follows: Code:
Here is the code i have so far... CPP / C++ / C Code:
I don't really know how to keep going, If anyone can help me with this or do it for me I would appreciate it more than you can ever imagine. Thanks Last edited by JdS : 10-Dec-2004 at 23:00.
Reason: Please insert [c] & [/c] tags between your example C codes
|
|||
|
#2
|
||||
|
||||
|
Quote:
First, use code tags (read the stickey) so we can read your code. Second, why can't you keep going? What is the problem you're facing? Where are you stuck? What does the code actually do now and what should it be doing? We need specific information and direction to know what the problem is, since we didn't write the code. And please, NEVER ask us to do it for you. I've already graduated and don't need the grade. Others have their own homework to do. And I would guess that the going rate for consultant programmers is probably out of your reach __________________
The 3 Laws of the Procrastination Society: 1) Never do today that which can be put off until tomorrow 2) Tomorrow never comes |
|
#3
|
|||
|
|||
Re: Student ID/Grades program help...i've got the same project to do and i cant seem to figure it out, any one have the solution?
|
|
#4
|
||||
|
||||
Re: Student ID/Grades program help...Hi kakamuti,
You miss semicolon at the end of the statements. And declare the functions how you would use it. some like: CPP / C++ / C Code:
First declare a character c before you use it. and As you learnt in your previous thread, Dont use scanf to get a character. Use getchar, as WaltP said, like this: CPP / C++ / C Code:
Regarding two dimensional array, you can be more clear like this kind: CPP / C++ / C Code:
And in the switch case statement, you should do something like this: CPP / C++ / C Code:
Regards, Paramesh. __________________
Don't walk in front of me, I may not follow. Don't walk behind me, I may not lead. Just walk beside me and be my friend. |
|
#5
|
|||
|
|||
Re: Student ID/Grades program help...anyone have this program or solution, i would be willing to pay someone to get me this program.
|
|
#6
|
||||
|
||||
Re: Student ID/Grades program help...We have no solution or program, and we wont do it for you.
Why dont you do this program yourself? We can to guide you. Paramesh. __________________
Don't walk in front of me, I may not follow. Don't walk behind me, I may not lead. Just walk beside me and be my friend. |
|
#7
|
|||
|
|||
Re: Student ID/Grades program help...i wish i could, im soo bad in C, i dont even know where to start, im trying to graduate this semester and this is soo useless to me, doesnt even have anyhting to do with my major just need to due this and pass.
|
|
#8
|
|||
|
|||
Re: Student ID/Grades program help...Code:
|
|
#9
|
|||
|
|||
Re: Student ID/Grades program help...Quote:
So use class notes, previous assignments, textbook examples, etc. to proceed Quote:
Instead of trying to write the whole thing all at once, I would do it one thing at a time. Make sure each step is correct (make a complete program and test it) and then go on to the next. Here is a possible approach: For example the very first thing: make an array. Now, Paramesh has given you a hint that lets us humans see a little more clearly what the 2-D array looks like. I have reformatted your code (but haven't changed it). The compiler will accept this or it will accept it the way that you wrote it (just enter a comma-delimited list of all of the elements). Doing it this way makes it easier for me to see exactly what is on each row. This makes editing and debugging easier (for me, at least). CPP / C++ / C Code:
Now compile this. You will get an error. How many rows did you declare? How many rows are in the array? Once you understand how to allocate and print a 2-D array, then go on to the next step. As you add new things, recompile often to eliminate syntax errors. When you have enough new stuff to test, stop coding and start testing. As you complete each task, save the program (under a different name), so that if you add a bunch of stuff that turns out to be a Bad Idea, you can fall back to a previous known good state. Regards, Dave |
|
#10
|
|||
|
|||
Re: Student ID/Grades program help...This thread has been brought back from the dead, it is a year old.
Date of WaltP post, 10-Dec-2004 23:46 |
Recent GIDBlog
Problems with the Navy (Officers) by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| [TUTORIAL] Calling an external program in C (Linux) | dsmith | C Programming Language | 4 | 22-Apr-2005 13:30 |
| fltk-2.0 cvs | Plumb | FLTK Forum | 20 | 13-Nov-2004 07:10 |
| Anyone can write a program code for this??? | chriskan76 | C Programming Language | 1 | 19-Oct-2004 20:25 |
| C binary file program | Newworld | C Programming Language | 5 | 11-Oct-2004 19:43 |
| Need help with a C program (Long) | McFury | C Programming Language | 3 | 29-Apr-2004 20:06 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The