Thread: Homework problem

  1. #1
    Registered User
    Join Date
    Apr 2002
    Posts
    2

    Smile Homework problem

    Hi,

    We're using Stephen Kochan's Book, Programming in ANSI C.
    We're up to the Arrays section (Chapter 7) and I am having trouble
    creating this program.

    "Write a program which asks your user to enter any number of numeric test grades between 0 and 100.
    Verify that each number entered is in the correct range. The user can enter the number 999 to terminate
    data entry. Data entry might look like this:

    Enter grade #1: 78
    Enter grade #2: 94
    Enter grade #3: 672
    Sorry, that's an incorrect value. Please try again.
    Enter grade #3: 67
    Enter grade #4: 82
    Enter grade #5: 999
    Thank you.

    Once the data has been read, print a bar chart that shows how many grades were between 95 to 100, 90 to
    94, 85 to 89, 80 to 84, 75 to 79, 70 to 74, 65 to 69, 60 to 64, and 0 to 59. The output may look like this:

    95-100: X
    90-94: XXX
    85-89: XXXXX
    80-84: XXXXXXX
    75-79: XXX
    70-74: XXXXXXXX
    65-69: X
    60-64: XX
    0-59: X

    Make sure your report lines up correctly on the first column of x's as shown above."


    Thank you for your help.

    I just can't seem to understand how to store the input properly.
    Once the input is stored I am thinking that I would be using many "IF/ELSE" statements to print the output.
    I just can understand how to store the input in the array.
    I appreciate anything you have to say.

  2. #2
    Registered User
    Join Date
    Apr 2002
    Posts
    2

    Thumbs up Thanks for your help!! :)

    Thanks for your help!!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. One More Homework Problem
    By joxerjen in forum C++ Programming
    Replies: 5
    Last Post: 10-12-2005, 04:39 PM
  2. searching problem
    By DaMenge in forum C Programming
    Replies: 9
    Last Post: 09-12-2005, 01:04 AM
  3. half ADT (nested struct) problem...
    By CyC|OpS in forum C Programming
    Replies: 1
    Last Post: 10-26-2002, 08:37 AM
  4. binary tree problem - help needed
    By sanju in forum C Programming
    Replies: 4
    Last Post: 10-16-2002, 05:18 AM
  5. homework assignment problem
    By Unregistered in forum C Programming
    Replies: 4
    Last Post: 10-29-2001, 10:24 AM