0
- Read the values of four bimonthly school grades of a student represented by the variables N1,N2,N3,N4. Calculate the arithmetic mean (variable MD1) of that student and display the message "Approved with average' if the average obtained is greater than 7.0; otherwise the program must request the fifth exam grade, represented by NE) and calculate a new, variable (MD2) average between the exam grade and the first average. If the average value is greater than or equal to 5, display the message "Approved with average"; otherwise display the message "Disapproved with average". Display the average value next to each message.
Here was the solution I found:
# mudei as variaveis e a quantidade de notas, mas a essencia é a mesma. do que foi pedido.
a = float(input('Nota 1: '))
b = float(input('Nota 2: '))
c = float(input('nota 3: '))
m1 = (a + b) / 2
if m1 >= 7:
print('Aprovado media %f' % m1)
else:
m2 = (m1 + c) / 2
if m2 >= 5:
print('Aluno aprovado media %f' % m2)
else:
if m2 < 4:
print('Reprovado media %f' % m2)
enter = input('\nPressione <ENTER> para encerrar...')
Such a solution would be satisfactory?
Did the answer solve your question? Do you think you can accept it? See [tour] if you don’t know how you do it. This would help a lot to indicate that the solution was useful for you. You can also vote on any question or answer you find useful on the entire site (when you have 15 points).
– Maniero