Thanks.
Type: Posts; User: Zeff
Thanks.
Is this any good ?
I'm pretty sure it will work, but I think that there is an easier way.
What do you guys think?
I was also working it like this:
for(i=0;i<n;i++) // going through each student
for(j=0;j<4;j++) // going through each grade within the structure (4 grades)
...
Yeah, I do not want to sort the student themselves(yet), just the 4 grades within each student
struct stud{
char name[30];
int grade[4];
float avg;
}
Then in the program i do this:
Thanks a lot. Appreciate it.
I will work on the program and post new code tomorrow.
Thanks again to all for the help.
#include <stdio.h>
void fill(int, int[]);
int main()
{
int n=1;
int grades;
int percentages[100];
Thanks Richie T .. I will look into what you wrote.
I did .. only on my last post though ..
I've just noticed that if the user enters 0 the first time, it will still be passed to the function instead to stoping the program. How can I fix that?
I tried looking ar other programs to remeber anything. I have some idea and I'm starting to remember how to program. With your help, it will be much easier. That's why I came to this forum.
Ok...
Sorry, but I had no internet access throughout the weekend. I'm back. The only thing I need to do with the program right now is the MAIN, and then pass to the first function. So I need to do this:
...
Any help with writing this function?
Ok thanks.
So now i try to write the whle function:
This is what it should do: The void function should fill percentages by asking the user what percent of the grade is each test. The sum of...
so passing to the function is correct
ex
fill(n,percentages) ?
Ohh ok.
void fill(int n, int percentages[]);
Ok, so something like this?
Int n=0;
int percentages[100];
void fill (int n, int []);
Printf("How many grades: ");
scanf("%d",&n);
and then
Thanks !
I'll do the lesson.
2 years ago when I was programming, i knew all this stuff. I just forgot simply everything.
Ok. so,
Int n=0;
int percentages[]; // it should be empty
Printf("How many grades: ");
scanf("%d",&n);
How do I then send the number N and the empty interger to a viod function?
Well, I'm just blanking on this.
Ok. First will come the printf statement which the user will give the N number of grades. N will be the number given to an integer array (percentages [n]. How do...
I have this program which I have to do. I am stuck because I haven't been programming in a while, therefore I forgot a couple of things. If anyone would be able to help me with anything and get me...