c++

posted by .

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

  • c++ -

    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.

  • c++ -

    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;
    }
    }

Respond to this Question

First Name
School Subject
Your Answer

Similar Questions

  1. c++

    write a program that reads ten numbers, computes their average and find out how many numbers are above average.
  2. 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 one …
  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 Statistics …
  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 appreciated. …
  5. 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
  6. 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 is …
  7. 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
  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 percent …
  9. programming

    Example Develop a pseudocode algorithm for a program that accepts each of the average marks of 10 students in a class and computes the sum and the average mark of the class. The program should display the average mark of the class. …
  10. 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 (not …

More Similar Questions