I should be able to help you on this one.
can you provide the source code you have so far? use wikisend.com to upload any files you have than post the download link there, I will have a look.
I don't have the files on hand right now. I will be able to send them in an hour. Is this ok? I am using visual studio 2010
yes its ok.
I will use VS2010 too, no problem.
ok, I'll wait for you to come back.
How do I send through wikisend.com
how long does it take
This is the url it went to after upload: http://wikisend.com/download/355994/
I put a password XXXXX it: stdt89
looking at it now
Can you see it? Because I'm not seeing it.
Do you think you will have an answer for me tonight?
yes, working on it.
stay online should be ready within next 30-45 minutes. just started to look at your source code
can you post here the full description again?
I have it ready
above is the screenshot from VS2010
Sorry back now.
use this linkhttp://ge.tt/4wSfn9z/v/0to download modified source code file
have a look give it a try and let me know if all ok
if you need clarifications or modifications let me know.
Here is the description again.
Create a structure to hold student names and averages. The structure should contain a first name, last name and an integer grade average.
Write a program that will do the following:
1.) Create an array of pointers to these student structures.
2.) Prompt the user for names and averages.
3.) After you get the student’s information use malloc to provide the memory to store the information.
4.) Place the address of the student, returned by malloc, into the pointer array.
5.) AFTER the user indicates there are no more students:
Search the data entered and find the highest and lowest grade average.
Print the name and grade for the highest grade
Print the name and grade for the lowest grade
Print the average of all grades entered
Do not do any searching for data until the user indicates there are no more students. The program should allow for the possible storage of up to 25 student pointers. You should use proper modularization to divide your program into logical functions.
A sample run is shown below.
Enter first name: Bob
Enter last name: Smith
Enter grade average: 86
Do you have more students? yes or no: y
Enter first name: Sally
Enter last name: Jones
Enter grade average: 92
Enter first name: Alice
Enter last name: Williams
Enter grade average: 68
Enter first name: Sam
Enter last name: Davis
Enter grade average: 79
Do you have more students? yes or no: n
Highest Grade: Sally Jones 92
Lowest Grade: XXXXX XXXXX 68
Average Grade: 81.25
already done.use this linkhttp://ge.tt/4wSfn9z/v/0to download modified source code file
if all ok, please do rate my answer.
I will not be able to run it until after six when I get on my PC.
Why is this used: #include "stdlib.h"
ok, I remember that now.
Thank you for being quick act this
to add a space before the line Do you have more students? yes or no: Can I put a \n in front of the question inside the parenthesis?
There also need to be two new lines before the Highest Grade: Sally Jones 92 Can I add \n\n before that question as well?
sorry was away for a while
yes you can put \n for newline
and \n\n for double new line
let me know if you were able to make it work, otherwise I will post updated source code file.
Ok, I will be away until around 6 est time
I will be online one more hour than away for 7-8
I am based in Europe.
Ok, if I can't get the little fix I mentioned to work then I will write back and wait for your response in the AM.
printf("\nDo you have more students? (y)es or (n)o: ");printf("\n\nHighest Grade: %s %s %d\n",data[highestGradeIndex]->firstname,data[highestGradeIndex]->lastname,data[highestGradeIndex]->average);
above are the two modifications you'll need to do to the file
and this is download link to modified file:http://ge.tt/8Ff1WAz/v/0
ok thanks. Will be able to check on visual studio tonight.
The programs runs great! Thanks
I have a couple questions about the functions.
I am trying to figure out what int nrStudents and *studentList?
What are the inputs for these functions?
Is the nrStudents the number of students in the structure?
is the *studentList the structure of students that were entered?
I look forward to the answers in the morning.
nrStudents is not a function is a variable
Its used inside the helper functions to loop through the array.
*studentList is an array of pointers to Student structure.
you need to know the number of students entered by user in order to know when to stop processing the studentList array. also its needed when computing the average (division of sum by total count).
each time data for a new user is entered the counter arrayIndex is incremented thus it always holds the number of total entries.
than, this arrayIndex is passed into helper functions as nrStudents.
and we used it in the for loop to process student structures one by one until our i index reaches nrStudents (means data from all students was processed and we can leave the loop).
if all ok please make sure to rate my answer. you will still be able to come back to this page for further clarifications, if required, on this question.