Пример #1
0
int main(){
    
	char unit;
	double temp;
	char ans;
	Temperature T;

	do{
	cout << "Please enter the temperature unit (Celsius = C, Kelvin = K, Fahrenheit = F): " << endl;
	cin >> unit;
	cout << "Please enter the temperature given the unit you entered previously: " << endl;
	cin>>temp;
	if (unit == 'C' || unit == 'c')
	{T.setTempCelsius(temp);}
	if (unit == 'F' || unit == 'F')
	{T.setTempFahrenheit(temp);}
	if (unit == 'K' || unit == 'K')
	{T.setTempKelvin(temp);}
	
	T.ShowResult();
	cout << "Re-calculate?" <<endl;
	cin>>ans;
	}while(ans=='Y'|| ans =='y');
	

}
Пример #2
0
bool test2() {
    Temperature temperature;
    temperature.setTempCelsius(50);
    return roundl(temperature.getTempKelvin()) == 323;
};