The main error in your code is you are making a simple average and in this case it has to be weighed at least I think, because they give weights to the notes. I made a code, tested the examples and worked perfectly. If you didn’t understand something ask.
#include <stdio.h>
#include <stdlib.h>
int main()
{
double nota_A,nota_B,media;
do
{
printf("\nDigite a nota A (0 a 10.0): ");
scanf("%lf",¬a_A);
if(nota_A < 0 || nota_A > 10.0)
printf("Nota inválida tente novamente\n");
}while(nota_A < 0 || nota_A > 10.0);
do
{
printf("\nDigite a nota B (0 a 10.0): ");
scanf("%lf",¬a_B);
if(nota_B < 0 || nota_B > 10.0)
printf("Nota inválida tente novamente\n");
}while(nota_B < 0 || nota_B > 10.0);
media = ((nota_A*3.5)+(nota_B*7.5))/(3.5+7.5); // Aqui é uma media ponderada e não uma media simples devido às notas terem pesos
printf("\nA média das notas A e B é de %.5lf",media); // coloquei %.5lf porque eles pedem 5 casas decimais
return 0;
}
I totally understand. I can’t believe it was just a lack of attention! Thank you very much and I’m sorry for the question, I should have revised my code with the statement, but I only read it once. Anyway, thank you!
– Thayná