Enter the names of n students and the 100 point scale, and count the students grades in sections.

Updated on educate 2024-04-02
3 answers
  1. Anonymous users2024-02-07

    The size of the array is defined when it is defined. I understand what you mean: first enter the number of students n to be counted, which is also to define an array of size n, a lazy way is that you pre-define a large array, far beyond the limit of what you can use, for example, you may count the results of 100 people, you can pre-define an array of size 1000 to store the grades, so that you can use a for loop.

    It's just that when you enter the score, you have to have a judgment to tell the program that your input is over, for example, when your input score exceeds 100, the input is over. But such a definition is a waste of memory.

    A better way is to build an array dynamically, which I implemented in C++, and here's the program, you see.

    #include

    using namespace std;

    int main()

    int i,n,count[6]=;

    cout<<"Enter the number of students you want to count:"<>n;

    int *score=new int[n];

    cout<<"Input"<>score[i];

    for(i=0;i=60)

    count[1]++

    else if(score[i]<=79&&score[i]>=70)

    count[2]++

    else if(score[i]<=89&&score[i]>=80)

    count[3]++

    else if(score[i]<=99&&score[i]>=90)

    count[4]++

    else if(score[i]==100)

    count[5]++

    cout<<"The statistical results are as follows:"coutreturn 0;

  2. Anonymous users2024-02-06

    1. Open Excel on the computer and input the performance data of six students.

    2. After entering the data, enter the formula in the sum of Xiao Ming's scores, because there are not many subjects, directly add them to the cells.

    3. After entering the formula, press the enter key to determine the formula, and you will get the sum of Xiao Ming's scores.

    4. After getting the sum of Xiao Ming's scores, pull down and copy the formula to get the sum of all students' scores.

    5. Select Sum of Students' Grades, click the Sort option on the start page, and then select Descending.

    6. After selecting descending order, the sum of students' grades will be ranked from high to low.

  3. Anonymous users2024-02-05

    <> in the above program, we first defined a structure student, which is used to store each student's name, student number, and grade. Then, we define an array of students, which contains 10 student structs. Next, we use a for loop to enter each student's name, student number, and grade in turn, and store them in the corresponding struct.

    Then, we count the number of people who fail using another for loop. If a student's score is less than 60 points, the number of students who fail will be added by 1.

    Finally, we output the number of people who fail.

Related questions
16 answers2024-04-02

'b').value

Or it can be passed between pages, and then used after the page is split by the value after the question mark of the url called by the script"|"Split to get username and email >>>More

9 answers2024-04-02

Since ln(1+1 n)<1 n (n=1,2,3,...)

So the first n terms of the harmonic series are satisfied and satisfied. >>>More

3 answers2024-04-02

In the CFA registration process in previous years, many CFA candidates are prone to make a mistake, that is, they confuse Family Name (surname) and Given Name (first name), so that they fill in the wrong form when registering, so everyone should pay special attention. >>>More

6 answers2024-04-02

The last name is the family name, and the surname is the surname. >>>More

6 answers2024-04-02

Turn off the input method.

Use Ctrl+Space. >>>More