Answered step by step
Verified Expert Solution
Question
1 Approved Answer
#include #define _CRT_SECURE_NO_WARNINGS int main( ) { FILE* fptr; int temp; int count = 0; int low, high, sum; double mean; fptr = fopen(Temperatures. txt,
#include #define _CRT_SECURE_NO_WARNINGS int main( ) { FILE* fptr; int temp; int count = 0; int low, high, sum; double mean; fptr = fopen("Temperatures. txt", "r"); scanf ("%d %d", &low, &high); while (fscanf (fptr, "%d", &temp) == 1) if (temp >= low && temp 0) mean = sum / count; printf("*d days had a temperature between *d and %d\\", count, low, high); printf ("The mean temperature between *d and *d is *.1If\\", low, high, mean); else printf ("0 days had a temperature between %d and *d\\", low, high); printf ("The mean value was not calculated, since there are zero days in the range"); return 0;A file called "Temperatures.txt" maintains a list of temperatures throughout ten days. Sample file entries are as follows 64 38 45 43 55 78 33 88 100 112 Develop a C program that asks the user to enter a temperature range. Then displays the number of days the temperature was within the specified range, as well as the average temperature in range. Sample Input 1 50 75 Sample Output 1 2 days had a temperature between 50 and 75 The mean temperature between 50 and 75 is 59.5 Sample Input 2 20 120 Sample Output 2 10 days had a temperature between 20 and 120 The mean temperature between 20 and 120 is 65.6 Sample Input 2 10 30 Sample Output 2 0 days had a temperature between 10 and 30 The mean value was not calculated, since there are zero days in the range 460148.2660426.qx3zqy7 LAB ACTIVITY 16.14.1: Lab 5, P1: Temperature Tracker 0/ 4 main.c Load default template... 1 #include 2 3 int main( ) { * Type your code here. */ return 0;1:Compare output 0 / 1 Input 50 75 2 days had a temperature between 50 and 75 Your output The mean temperature between 50 and 75 is 59.0 Your output does not 2 days had a temperature between 50 and 75 contain The mean temperature between 50 and 75 is 59.5 2:Compare output 0 / 1 Input 20 120 10 days had a temperature between 20 and 120 Your output The mean temperature between 20 and 120 is 65.0 Your output does not 10 days had a temperature between 20 and 120 contain The mean temperature between 20 and 120 is 65.6
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started