Thread: test scores

  1. #1
    Registered User
    Join Date
    Oct 2001
    Posts
    24

    test scores

    ok, don't mean to be long but i need help with a program and i want to give all the necessary information. I have coded the program however, am having problems with it. Here is the program:

    Write a program that accepts a student identification number and three test scores, test1, test2, and final_test, as input and then determine outputs for each student the semester average and the final letter grade according to the following scheme:

    Semester Average Final Letter Grade
    90-100 A
    80-89 B
    70-79 C
    60-69 D
    0-59 F

    The semester average for students is computed using the following formula: semester_average =0.2.*test1+0.30*test2+0.50*final_test

    students identification numbers are nonzero integers. Input should terminate when the instructor types 0 for student identification number. The instructor also wants a distribution of letter grades and a class average. Class average is computed using the following formula:
    clas_average=(4* number_of_A_grades +3*number_of_B_gardes+2*number_of_C_grades+1*numbe r_of_D_grades)/number_of_students. This is all the required information now here is my code and as always thanks for all the help!!!!!!!!!!!!!!!!!!!

    #include <stdio.h>

    int main (void) {
    /* Variable declarations: */

    double grade;

    /* Function body: */

    printf ( "A program that prints letter grades\n");
    printf ( "Enter grade\n");
    scanf ( "%1f", &grade);

    if (grade >= 90)
    printf ( "Grade = 'A' ");

    else if (grade >= 80)
    printf ( "Grade = 'B'");

    else if (grade >= 70)
    printf ( "Grade = 'C'");

    else if (grade >= 60)
    printf ( "Grade = 'D'");

    else
    printf ( "Grade = 'F'");


    /* end if*/

    return grade;

    } /* end function main*/

    Sample program design according to the book:
    ****> Enter student idno: 1100
    ****> Enter test score 1: 70
    ****> Enter test socre 2: 80
    ****> Enter final score: 100
    Semester average for student 1100: 88
    Letter grade for student 1100 : B

    ****> Enter studnt idno: 1200
    ****> Enter test socre 1: 75
    ****> Enter test score 2: 65
    ****> Enter final score: 76
    Semester averag for student 1200: 73
    Letter grade for student 1200 : C

    ****> Enter student idno: 0
    Grade distributions:
    A 4
    B 6
    C 7
    D 2
    F 0

    Class Average: 2.63

  2. #2
    free(me);
    Join Date
    Oct 2001
    Location
    Santo Domingo, DN, Dominican Republic
    Posts
    98

    ...

    ok, don't mean to be long but i need help with a program and i want to give all the necessary information. I have coded the program however, am having problems with it.
    What are these problems you are having?

    adios,
    biterman.
    Do you know how contemptous they are of you?

  3. #3
    Registered User
    Join Date
    Oct 2001
    Posts
    24
    biteman why is that? If I have done anything wrong then forgive me and look over my post. Just tring to seek help not to break any law or anything! Since yo asked, the problem I was havein was with codeing the studnet number and getting the program to look like the output, but please don't respond I will continue to read and seek help else where. Again thanks for the help.

    Also, biteman, well never mind, again thanks!

  4. #4
    free(me);
    Join Date
    Oct 2001
    Location
    Santo Domingo, DN, Dominican Republic
    Posts
    98

    Question ...

    Why is what?

    I was just trying to help. But in order for me to able to do that you need to ask more specific questions.
    Since yo asked, the problem I was havein was with codeing the studnet number and getting the program to look like the output
    Well think about it...

    1. You have to keep asking for StudentID's and grades until input is 0.
    2. You have to keep count of the number of instances of each letter grade.
    3. You have to calculate the semester avg of each student and it's respective letter grade.
    4. Print the info gathered on step 2.
    5. You have to calculate the class avg, for this you'll use the info you got in step 2.

    The way you phrased your questions gave the impression that you basically wanted someone to do the exercise for you.

    Think about in the terms i mentioned above, then try to solve each step. I think that should help.

    I think that's pretty much all i can do for you, short of writing it for you.

    Hope it helps...

    adios,
    biterman.
    Do you know how contemptous they are of you?

  5. #5
    ATH0 quzah's Avatar
    Join Date
    Oct 2001
    Posts
    14,826
    I'm guessing your tag line confused them.

    Quzah.
    Hope is the first step on the road to disappointment.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Integer Emulation
    By Elysia in forum C++ Programming
    Replies: 31
    Last Post: 03-18-2008, 01:03 PM
  2. Another class assignment, please help.
    By WinterInChicago in forum C++ Programming
    Replies: 16
    Last Post: 11-09-2006, 11:51 AM
  3. undefined reference
    By 3saul in forum Linux Programming
    Replies: 12
    Last Post: 08-23-2006, 05:28 PM
  4. C++ Operator Overloading help
    By Bartosz in forum C++ Programming
    Replies: 2
    Last Post: 08-17-2005, 12:55 PM
  5. MSVC Template Constructor/Assignment Errors
    By LuckY in forum Windows Programming
    Replies: 3
    Last Post: 07-22-2005, 02:57 PM