![]() |
|
#1
|
|||
|
|||
Convert to structureanyone can help me to convert this c coding to a structure...i dont know how to do it...Plz help me....
CPP / C++ / C Code:
|
|||
|
#2
|
|||
|
|||
Re: Convert to structureOne doesnt generally convert code to structure. Can you elaborate on what exactly it is you need?
__________________
My personal site: Utilities for text processing, debugging, testing and plotting |
|
#3
|
||||
|
||||
Re: Convert to structureCreate a structure (student) containing these fields
CPP / C++ / C Code:
Most function calls can be simplified by passing the structure instead of each array as you do now. __________________
During the election they said Obama could only be elected when pigs fly. Well, we currently have an epidemic of Swine Flu. Coincidence? |
|
#4
|
|||
|
|||
Re: Convert to structureThis is the guideline,,,my lecturer ask me to convert the given coding with more easiest coding...short coding with structures ..
like when i execute the coding given...its ask me to enter number of student.. i enter 3....then it ask me to enter name, then enter result for 3 subject and then enter gpa for the 3 subjects given...the same repeated for 3 student and the result of the gpa is given at the end ..the example is like below.. ![]() Anyone can help me to create the same output using own coding...difference from the one i gave above...thank you alot frens.... |
|
#5
|
|||
|
|||
Re: Convert to structureThis is the question my lecturer gave to me...
Write a program that will read the name of a student and the three marks from three different courses entered by a user. For each course the credit hour is specified as 2, 3 or 4. The program continues to take these inputs until the maximum number of student (the maximum number is determined by the user). Store these inputs in the array. Calculate the GPA for each student based on the Grade Point below: Marks Range Grade Grade point 80 - 100 A 4 70 - 79 B 3 60 - 69 C 2 50 - 59 D 1 < 49 F 0 Example: Course A 87 A 3 credit hour Course B 77 B 3 credit hour Course C 65 C 3 credit hour So, GPA = ((3 X 4) + (3 X 3) + (3 X 2)) / 9 = 3.00 |
|
#6
|
|||
|
|||
Re: Convert to structureTry to think of the objects involved:
A STUDENT has a name three courses. Each COURSE has CREDIT HOURS and a MARK. So: CPP / C++ / C Code:
|
|
#7
|
|||
|
|||
Re: Convert to structureQuote:
I like your coding bro Fakepoo....but i dunno which header to use....i try execute in my vb6 and shows errors...and the file i must save for the assignment is in (.c) I hope i can view the full start and end of the coding to make some studies on it... Thanks alot fakepoo.........i really appreciate it |
|
#8
|
|||
|
|||
Re: Convert to structureIn order to compile, you will need to include string.h (for strcpy)and stdio.h (for printf).
CPP / C++ / C Code:
Could the problem be that you are trying to compile a C program with a Visual Basic compiler? |
|
#9
|
|||
|
|||
Re: Convert to structureYes bro fakepoo...im using visual basic 6.0 because in my course ,we using this compiler and save the file in .c format...
CPP / C++ / C Code:
The errors shown is : Quote:
|
|
#10
|
|||
|
|||
Re: Convert to structureTry compiling this:
CPP / C++ / C Code:
|
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 |
| 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