234k views
0 votes
Write a program that estimate the temperature in a freezer(in oC) given the elapsed time (hours) since a power failure.Assume this (T) is given

T = 4t2 / t +2 - 20.

User Uours
by
7.8k points

1 Answer

4 votes

Answer:

#include <bits/stdc++.h>

using namespace std;

int main() {

double time_h,temp_c;//declaring two variables for time and temperature of type double.

cout<<"Enter the time"<<endl;

cin>>time_h;//taking input of the time...

temp_c=((4*2*time_h)/(time_h+2)-20);//calculating the temperature...

cout<<temp_c<<endl;//printing the temperature..

return 0;

}

Step-by-step explanation:

I have taken 2 variables of type double.

I am taking input of time from the user.

Then after that calculating the time according to the equation.

Then printing the output.

User Ellie
by
7.5k points