Drop Lowest Grade then Average

This is a discussion on Drop Lowest Grade then Average within the C Programming forums, part of the General Programming Boards category; Need a program that drops the lowest grade of a random amount of grades, then averages those grades. Have to ...

  1. #1
    Registered User
    Join Date
    Sep 2002
    Posts
    3

    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.

    Help!!

    Thanks!

    Cheryl

  2. #2
    Green Member Cshot's Avatar
    Join Date
    Jun 2002
    Posts
    892
    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
    Posts
    3
    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
    Unleashed
    Join Date
    Sep 2001
    Posts
    1,765
    > 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
    Posts
    3
    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, 01: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-24-2007, 12:05 AM
  4. I have a function and I need multiple averages returned
    By tommy69 in forum C++ Programming
    Replies: 20
    Last Post: 04-13-2004, 12:45 PM
  5. Creating a student grade book-how?
    By Hopelessly confused in forum C Programming
    Replies: 5
    Last Post: 10-03-2002, 09:43 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21