Results 1 to 2 of 2

Thread: help me please

  1. #1
    JAM1996 is offline Member
    Join Date
    Sep 2012
    Location
    Utah
    Posts
    7
    Rep Power
    0

    Default help me please

    i need to find the sum and average for a set of uncounted set of test scores via loops. The last number in the data will be zero and should not be processed. Pretend that you were given an external file that had the numbers below AND a zero then 4 more numbers.But, you have to do this via file input and not n=by just typing the numbers in(lets say the files name is"rt54.txt"
    Also, it should look like the following once completed:
    Scores
    3
    8
    1
    13
    18
    15
    7
    17
    1
    14
    The sum of the numbers = 97
    The number of scores = 10
    The average of the numbers = 9.7



    First of all, how can i make it stop looping so that the last number in the data will be zero and should not be processed?

  2. #2
    quad64bit's Avatar
    quad64bit is offline Moderator
    Join Date
    Jul 2009
    Location
    VA
    Posts
    1,323
    Rep Power
    6

    Default Re: help me please

    So, read input until the input is null! What have you tried?

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •