![]() |
|
#21
|
|||
|
|||
Re: Convert to structureCPP / C++ / C Code:
Code:
plz help me...i need to submit this in 2 days time.....HELP...HELP...im really a noob with c... |
|||
|
#22
|
|||
|
|||
Re: Convert to structureHoly crap. That's the best you can do? You've got two main()'s in there!
Do yourself a favor and give the weed to a good friend (who doesn't smoke weed) for a few days so you can pay attention and get this assignment done! You titled this thread "Convert to Structure" but it doesn look to me like you are ready for C structures or even functions. . Your assignment mentions neither and barely mentions "array". It looks like it's intended to point out that arrays can only hold one data and how difficult it becomes to manage data of different types with them . Seems to me that your level is just a notch up from "hello world"... so you should just be keeping your whole program in the main() function and not worry about adding other functions at this point.. So go back to that assignment you posted and break it out into the main tasks and sub tasks that will need to be done: Code:
You alse referred us to an image which showed an samle run sequence: Code:
So start from step one and write your own work instead of guessing your way through others'. Suppose you just get the user input portion done first and then move on to the calculation part. For example: CPP / C++ / C Code:
Code:
Make a plan of the changes you will need to make and impement them ONE AT A TIME!!!! and test test test... |
|
#23
|
|||
|
|||
Re: Convert to structureCPP / C++ / C Code:
plz help me with the calculation part... like i enter : mark course 1= 45 mark course 2=67 mark course 3= 88 cdt hour for course 1= 3 cdt hour for course 2= 2 cdt hour for course 3= 4 so the calculation will go like this : mark course 1* cdt hour course1 +mark course 2* cdt hour course2+mark course 3* cdt hour course3 / total cdt hour of course 1,2,3 .. and it follow this rule CPP / C++ / C Code:
where in output....it will show the gpa.... |
|
#24
|
|||
|
|||
Re: Convert to structureYou really need to think about your data types. It seems to me that a GPA should hold real numbers (float or double), not just whole numbers (int).
In other words, compute_gpa() should take a student_struct* as a parameter and fill that structure's gpa (float) field. Maybe something like: CPP / C++ / C Code:
|
Recent GIDBlog
Toyota - 2009 May Promotion by Nihal
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Structure with in a structure | knockout_artist | C Programming Language | 3 | 19-Dec-2007 12:08 |
| Allocating memory to a structure | Printisor | C Programming Language | 4 | 29-Jun-2007 09:00 |
| Convert the input into square yards | pjpav | Java Forum | 1 | 08-Oct-2005 08:43 |
| [CONTEST?]Data Structure Test | dsmith | C Programming Language | 2 | 06-Jun-2004 16:13 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The