How JustAnswer Works:

  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.

Ask unvadim Your Own Question

unvadim
unvadim, Engineer
Category: Homework
Satisfied Customers: 1170
Experience:  Work experience in IT of more than 6 years. Good knowledge of various programming languages.
Type Your Homework Question Here...
unvadim is online now
A new question is answered every 9 seconds

Is this program simple? I cant seem to get started on it?

Resolved Question:

Is this program simple? I can't seem to get started on it? I was wondering if you could give me some guidance to start this?

Program:

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.


Sample Run

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

Do you have more students? yes or no: y
Enter first name: Alice
Enter last name: Williams
Enter grade average: 68

Do you have more students? yes or no: y
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
Submitted: 5 months ago.
Category: Homework
Expert:  unvadim replied 5 months ago.

unvadim :

Hi

unvadim :

I should be able to help you on this one.

unvadim :

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.

Customer:

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

unvadim :

yes its ok.

unvadim :

I will use VS2010 too, no problem.

Customer:

Awesome Thanks

unvadim :

ok, I'll wait for you to come back.

Customer:

How do I send through wikisend.com

Customer:

how long does it take

Customer:

This is the url it went to after upload: http://wikisend.com/download/355994/

Customer:

I put a password XXXXX it: stdt89

unvadim :

ok thanks

unvadim :

looking at it now

Customer:

Can you see it? Because I'm not seeing it.

Customer:

Do you think you will have an answer for me tonight?

unvadim :

yes, working on it.

unvadim :

stay online should be ready within next 30-45 minutes. just started to look at your source code

unvadim :

can you post here the full description again?

unvadim :

you there?

unvadim :

I have it ready

unvadim :

Full Size Image

unvadim :

Full Size Image

unvadim :

above is the screenshot from VS2010

Customer:

Sorry back now.

unvadim :

use this link
http://ge.tt/4wSfn9z/v/0
to download modified source code file

unvadim :

have a look give it a try and let me know if all ok

unvadim :

if you need clarifications or modifications let me know.

Customer:

Here is the description again.

Customer:

Assignment 10


 


 


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.


 


 


Sample Run


 


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


 


Do you have more students? yes or no: y


Enter first name: Alice


Enter last name: Williams


Enter grade average: 68


 


Do you have more students? yes or no: y


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


 


 

unvadim :


already done.use this link
http://ge.tt/4wSfn9z/v/0
to 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.



unvadim :

if all ok, please do rate my answer.

Customer:

I will not be able to run it until after six when I get on my PC.

Customer:

Why is this used: #include "stdlib.h"

unvadim :

ok

unvadim :

for malloc

Customer:

ok, I remember that now.

Customer:

Thank you for being quick act this

Customer:

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?

Customer:

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?

unvadim :

Hi

unvadim :

sorry was away for a while

unvadim :

yes you can put \n for newline

unvadim :

and \n\n for double new line

unvadim :

let me know if you were able to make it work, otherwise I will post updated source code file.

Customer:

Ok, I will be away until around 6 est time

unvadim :

I will be online one more hour than away for 7-8

Customer:

7-8 hours?

unvadim :

yes

unvadim :

I am based in Europe.

Customer:

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.

unvadim :

ok

unvadim :

actually.....

unvadim :

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);

unvadim :

above are the two modifications you'll need to do to the file

unvadim :

and this is download link to modified file:
http://ge.tt/8Ff1WAz/v/0

Customer:

ok thanks. Will be able to check on visual studio tonight.

unvadim :

ok

Customer:

The programs runs great! Thanks

Customer:

I have a couple questions about the functions.

Customer:

I am trying to figure out what int nrStudents and *studentList[]?

Customer:

What are the inputs for these functions?

Customer:

Is the nrStudents the number of students in the structure?

Customer:

is the *studentList[] the structure of students that were entered?

Customer:

I look forward to the answers in the morning.

unvadim :

nrStudents is not a function is a variable

unvadim :

Its used inside the helper functions to loop through the array.

unvadim :

*studentList[] is an array of pointers to Student structure.

unvadim :

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).

unvadim :

each time data for a new user is entered the counter arrayIndex is incremented thus it always holds the number of total entries.

unvadim :

than, this arrayIndex is passed into helper functions as nrStudents.

unvadim :

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).

unvadim :

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.

unvadim, Engineer
Category: Homework
Satisfied Customers: 1170
Experience: Work experience in IT of more than 6 years. Good knowledge of various programming languages.
unvadim and 3 other Homework Specialists are ready to help you

JustAnswer in the News:

 
 
 
Ask-a-doc Web sites: If you've got a quick question, you can try to get an answer from sites that say they have various specialists on hand to give quick answers... Justanswer.com.
JustAnswer.com...has seen a spike since October in legal questions from readers about layoffs, unemployment and severance.
Web sites like justanswer.com/legal
...leave nothing to chance.
Traffic on JustAnswer rose 14 percent...and had nearly 400,000 page views in 30 days...inquiries related to stress, high blood pressure, drinking and heart pain jumped 33 percent.
Tory Johnson, GMA Workplace Contributor, discusses work-from-home jobs, such as JustAnswer in which verified Experts answer people’s questions.
I will tell you that...the things you have to go through to be an Expert are quite rigorous.
 
 
 

What Customers are Saying:

 
 
 
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
< Last | Next >
  • Wonderful service, prompt, efficient, and accurate. Couldn't have asked for more. I cannot thank you enough for your help. Mary C. Freshfield, Liverpool, UK
  • This expert is wonderful. They truly know what they are talking about, and they actually care about you. They really helped put my nerves at ease. Thank you so much!!!! Alex Los Angeles, CA
  • Thank you for all your help. It is nice to know that this service is here for people like myself, who need answers fast and are not sure who to consult. GP Hesperia, CA
  • I couldn't be more satisfied! This is the site I will always come to when I need a second opinion. Justin Kernersville, NC
  • Just let me say that this encounter has been entirely professional and most helpful. I liked that I could ask additional questions and get answered in a very short turn around. Esther Woodstock, NY
  • Thank you so much for taking your time and knowledge to support my concerns. Not only did you answer my questions, you even took it a step further with replying with more pertinent information I needed to know. Robin Elkton, Maryland
  • He answered my question promptly and gave me accurate, detailed information. If all of your experts are half as good, you have a great thing going here. Diane Dallas, TX
 
 
 

Meet The Experts:

 
 
 
  • Manal Elkhoshkhany's Avatar

    Manal Elkhoshkhany

    Tutor

    Satisfied Customers:

    4514
    More than 5000 online tutoring sessions.
< Last | Next >
  • http://ww2.justanswer.com/uploads/BU/BusinessTutor/2012-2-2_115741_Kouki2.64x64.jpg Manal Elkhoshkhany's Avatar

    Manal Elkhoshkhany

    Tutor

    Satisfied Customers:

    4514
    More than 5000 online tutoring sessions.
  • http://ww2.justanswer.com/uploads/LI/lindaus/2012-6-10_04811_IMG20120609164157.64x64.jpg Linda_us's Avatar

    Linda_us

    Finance, Accounts & Homework Tutor

    Satisfied Customers:

    3099
    Post Graduate Diploma in Management (MBA)
  • http://ww2.justanswer.com/uploads/lanis/2009-4-1_233717_phput9xef_c1pm.jpg Lani S.'s Avatar

    Lani S.

    Tutor

    Satisfied Customers:

    2453
    Registered Nurse, Internet Researcher, Private Tutor
  • http://ww2.justanswer.com/uploads/chooser77/2009-08-18_162025_Chris.jpg Chris M.'s Avatar

    Chris M.

    M.S.W. Social Work

    Satisfied Customers:

    2258
    Master's Degree, strong math and writing skills, experience in one-on-one tutoring (college English)
  • http://ww2.justanswer.com/uploads/ComputersGuru/2010-02-13_051118_Photo41.JPG LogicPro's Avatar

    LogicPro

    Engineer

    Satisfied Customers:

    2193
    Expert in Java C++ C C# VB Javascript Design SQL HTML
  • http://ww2.justanswer.com/uploads/JawaadAhmed/2009-6-27_12137_SIs_SHadi.jpg F. Naz's Avatar

    F. Naz

    Chartered Accountant

    Satisfied Customers:

    1962
    Experience with chartered accountancy
  • http://ww2.justanswer.com/uploads/JK/jkcpa/2011-1-16_182614_jkcpa.64x64.jpg Bizhelp's Avatar

    Bizhelp

    CPA

    Satisfied Customers:

    1865
    Bachelors Degree and CPA with Accounting work experience