Find the average score after calculating the test scores of each of the four students in three subjects and keying them into a two-dimensional array.

Asked 2 years ago, Updated 2 years ago, 17 views

I programmed with Python, but it doesn't look like a problem sentence.
Please tell me what's wrong with this.
Also, what is the correct program (similar to this image)?

from numpy import*
pmax = 5
mmax = 4
x=zeros(mmax,pmax), dtype=int)
ps=zeros(pmax,dtype=int)
ms=zeros(mmax,dtype=int)
for pin range (len(x[0])):
    for min range (len(x)):
        x[m][p]=int(input('>'.format(p,m+1))))
        ms[m] = ms[m] + x[m] [p]
        ps[p] = ps[p] + x[m][p]
print('Subject 0 Subject 1 Subject 2 Average')
for min range (mmax):
    print('{{0:1d}student''.format(m+1), end=')
    for pin range (pmax):
        print('{0:6d} point' .format(x[m][p]), end='')
    print('{0:6d} point'.format(ms[m]))
print('Average', end=')
for pin range (pmax):
    print('{0:6d} point' .format(ps[p]), end='')

I programmed with Python, but it doesn't look like a problem statement

python

2022-09-29 21:57

1 Answers

Please tell me what's wrong with this. is like this.

  • There are 4 students in 3 subjects, but the corresponding maximum is set to something wrong.
  • There is no explanation for what each defined/initialized constant/variable represents.
  • At some point, there is nothing to guide you through which students and which subjects you are entering.
  • It says "Find the average point", but it does not calculate the average point.
  • Similarly, "Find the average score" seems to show both the average score of an individual and the average score of each subject, but it is not clear whether it meets the challenge?

Even if finding mistakes is a challenge for themselves, I avoid making any specific points.
If you are a programmer, please use the above to find and correct the problem.


2022-09-29 21:57

If you have any answers or tips


© 2024 OneMinuteCode. All rights reserved.