I need to do the following
Create an algorithm where you calculate by means of several temperature inputs the percentage outside the variance stipulated as maximum and minimum having as out of values + -3 from stipulated temperature values, otherwise the desired values, and should present the percentage referring to the to what is left out.
Where I came from:
#include<stdio.h>
#include<string.h>
int main(void){
float entrance;
char Str[50];
FILE *arq;
char Linha[100];
char *result;
int i;
// Abre um arquivo TEXTO para LEITURA
arq = fopen("arq.txt", "rt");
if (arq == NULL){
printf("Problemas na abertura do arquivo\n");
return;
}
i = 1;
while (!feof(arq)){
result = fgets(Linha, 100, arq);
if (result)
i++;
}
fclose(arq);
puts("\n\t ");
puts("\t - - imported file - - ");
puts(" press Enter... ");
getchar();
puts("\t* SELECIONE UMA OPCAO DESEJADA: *");
puts("\t* *");
puts("\t* 1 3 graus celcius *");
puts("\t* 2 -3 graus celcius *");
puts("\t* 3 -5 graus celcius *");
puts("\t* 4 -8 graus celcius *");
puts("\t* 5 -12 graus celcius *");
puts("\t* 6 -15 graus celcius *");
puts("\t* 7 -18 graus celcius *");
scanf("%f",&entrance);
/*
--FAZER A MEDIA DOS VALORES E MOSTRAR A PORCENTAGEM QUE
FICA FORA DE ACORDO COM O VALOR DE 'ENTRANCE'
--APRESENTAR RESULTADO EM TELA E RETORNAR EM ARQUIVO .TXT
*/
getchar();
return 0;
}
I do not know exactly how to do this part
- MAKE THE VALUE OF THE VALUES AND SHOW THE PERCENTAGE THAT STAY AWAY FROM THE 'ENTRANCE' VALUE
- PRESENT SCREEN RESULT AND RETURN TO .TXT FILE