#WSQ05-Temperature

Hey guys since I have already told you I am catching up!!…

What I had to do for this #WSQ05 well is simple… I made a program that will prompt the user for a temperature in Fahrenheit and then convert it to Celsius. You may recall that the formula is C = 5 ∗ (F − 32)/9.

Modify the program to state whether or not water would boil at the temperature given.

This is what i did…//Code starts from next line

//CODE

#include <iostream>
using namespace std;

int main(int argc, char const *argv[]) {
float fa;
int cel;

std::cout << “This program can determine the temperature from Farenheit to Celcius.” << std::endl;
std::cout << “Please enter the temperature in ºFarenheit.” << std::endl;
std::cin >> fa;
cel=(int)5*(fa-32)/9;
std::cout << “The temperature given in ºCelcius is… “<<cel << std::endl;
if (cel>100) {
std::cout << “The water can boil at this temperature at typical conditions… Be careful!” << std::endl;
}
else{
std::cout << “The water does not boil at this temperature.” << std::endl;
}
return 0;
}

Captura de pantalla 2016-02-17 a las 18.30.35

CC BY-SA 4.0 #WSQ05-Temperature by everolivares is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.