c++

write a program that reads ten numbers, computes their average and find out how many numbers are above average.

  1. 👍 0
  2. 👎 0
  3. 👁 103
  1. We are not going to do it for you. If you want to post what you have done and why it doesn't work as expected, we can make suggestions to correct/improve the program.

    1. 👍 0
    2. 👎 0
    posted by Dr Russ
  2. int userVal=0;
    int sum=0;
    int avg=0;
    int aboveAvg=0;

    for(int i=0;i<11;i++)
    {

    cout<< "Enter a value"<<endl;
    cin>> userVal;

    sum=userVal+sum;

    }

    avg=sum/10;
    cout<<avg<<endl;

    for (int j=0;j<11;j++)
    {

    if(userVal>avg)
    {
    aboveAvg=userVal;
    cout<<"Numbers above the average are "<<aboveAvg<<endl;
    }
    }

    1. 👍 0
    2. 👎 0
    posted by gabbi

Respond to this Question

First Name

Your Response

Similar Questions

  1. c++

    write a program that reads ten numbers, computes their average and find out how many numbers are above average.

    asked by nethiyaa on May 10, 2011
  2. Programming

    Read two numbers from the keyboard Display the menu options as follows: 1 - computes the sum of two numbers. 2 - computes the difference (first minus second). 3 - computes the product of the two numbers. 4 - if the second number

    asked by Shawn on October 30, 2012
  3. Programming

    I need your help to write a program using visual basic 2010 for the following:- write a program that calculates the average of up to 50 numbers input by the user and stored in an arrey. The program should use a class named

    asked by Solomon on May 13, 2011
  4. Programming

    Here is the question that I need help to write the code for the following program in Visual Basic 2010. I am trying to write the code but it has a run time error. If your could helps me to write the code it would be greatly

    asked by Solomon on May 18, 2011
  5. computer

    Write an algorithm for a program that accepts a set of numbers and finds the smallest among them and computes the sum of the numbers accepted. The program stops when the user enters number 999. Convert the algorithm into flowchart

    asked by Anonymous on December 7, 2015
  6. Programming

    I suppose to write a program that calculates the average of up to 50 numbers input by the user and stored in an array. The program should use a class name Statistics and have an AddNumber method that stores numbers into an arrey

    asked by Solomon on May 11, 2011
  7. computer programming

    Design the logic for a program that allows a user to enter any amount of numbers up to 10 or until a sentinal value of -1 is entered. Then the program displays the count of the numbers entered and numeric average of the numbers

    asked by robert on February 28, 2017
  8. computer science

    Write a java program that reads from the user the course code, section and the scores of a student for three exams representing two midterms and a final. The percentage of each of the three exams is of fixed value 30, 30 and 40

    asked by rayn on March 13, 2016
  9. MATH

    WRITE A SIMPLE BUT A COMPLETE FORTRAN PROGRAM TO COMPUTE THE AVERAGE OF SIX NUMBERS AND DISPLAY THE NUMBERS, SUM AND AVVERAGE. THE PROGRAM SHOULD TERMINATE WHEN ZERO IS ENTERED AS A NUMBER. THE PROGRAM SHOULD BE EDUCATIVE

    asked by EDWIN on June 15, 2011
  10. computer Science

    1. Create a program which will allow the user enter ten numbers. The program is to count how many numbers were above 50. Hint: You will need to incorporate a Selection (If…then) statement.

    asked by Jhon on January 25, 2016

More Similar Questions