Thread: Drop Lowest Grade then Average

  1. #1
    Registered User
    Join Date
    Sep 2002

    Talking Drop Lowest Grade then Average

    Need a program that drops the lowest grade of a random amount of grades, then averages those grades. Have to use a counter controlled for loop nested inside a sentinel controlled input loop.




  2. #2
    Green Member Cshot's Avatar
    Join Date
    Jun 2002
    Post what you've done so far and we'll be glad to help you through it. If you expect us to do your homework for you, look elsewhere.
    Try not.
    Do or do not.
    There is no try.

    - Master Yoda

  3. #3
    Registered User
    Join Date
    Sep 2002
    Well.. here's what I have .. not much to work with.

    ..thank you in advance for any help/pointers you can provide.

    int main(void)

    float average;
    int total = 0, numscore, score, ID;

    printf("Enter the number of scores each student has: ");
    scanf(%d", &numscore);

    while (ID != -1){

    int counter;

    for (counter = 1; counter <= numscore; counter++){
    printf("Enter a score: \n");
    scanf("%d", &score);

    average = (float) total / numscore;

    if (average >= 50.0)
    grade = S;
    if (average > 50.0)
    grade =U;

  4. #4
    Join Date
    Sep 2001
    > scanf(%d", &numscore);
    Well, fix the %d" into "%d" first.

    Return 0 at the end of main, and if you do, post the end of main for us to view along with any relevant functions if applicable.
    You have not declared or initalized grade.
    Snag a few tutorials and see what you can manage, then post the heap if you're stuck.
    This isn't a hard solution.
    The world is waiting. I must leave you now.

  5. #5
    Registered User
    Join Date
    Sep 2002
    That's nice -- thanks

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. C program using structs to calculate grades
    By TampaTrinDM88 in forum C Programming
    Replies: 4
    Last Post: 07-06-2009, 12:33 PM
  2. Replies: 3
    Last Post: 02-22-2009, 02:54 PM
  3. Moving Average Question
    By GCNDoug in forum C Programming
    Replies: 4
    Last Post: 04-23-2007, 11:05 PM
  4. I have a function and I need multiple averages returned
    By tommy69 in forum C++ Programming
    Replies: 20
    Last Post: 04-13-2004, 11:45 AM
  5. Creating a student grade book-how?
    By Hopelessly confused in forum C Programming
    Replies: 5
    Last Post: 10-03-2002, 08:43 PM