Search

Blogging through my thoughts

Felipe GM : ¡Be welcome to my personal and academical blog!

Tag

#WSQ02

WSQ02 – Temperature (fahrenheit to celsius).

**Updated post**

Hello friends !

For this task , my classmates and I were instructed to create a program that will prompt the user for a temperature in Fahrenheit and them convert it to Celsius. The formula that made the conversion possible was  C = 5 ∗ (F − 32)/9  (where F = Fahrenheit).

The resources that helped me were:
-cpluplus.com
-How to think like a computer scientist.

I added some extra steps to show more information to the user , depending on the number (x) given , like if:

-Water boils at x temperature.

-Water is in its solid state, ice.

-Water, in its solid state, becomes liquid due to its melting point.

-Water does not boil at this temperature.

It was a fun and entertaining task.

WSQ02ATOM
Atom code
WSQ02UBUNTU
Ubuntu bash

masteryWSQ02

WSQ 02 – Temperature.

This is my second program , created using cygwin and atom. For this task , my classmates and I were instructed to create a program that will prompt the user for a temperature in Fahrenheit and them convert it to Celsius. The formula that made the conversion possible was  C = 5 ∗ (F − 32)/9  (where F = Fahrenheit).

The resources that helped me were:
-cpluplus.com
-How to think like a computer scientist.

I added some extra steps to show more information to the user , depending on the number (x) given , like if:

-Water boils at x temperature.

-Water is in its solid state, ice.

-Water, in its solid state, becomes liquid due to its melting point.

-Water does not boil at this temperature.

It really was a fun and entertaining task.

 

Here you will find my code and some captures:

wsq02-code
Atom code.

-Atom code:

#include <iostream>
using namespace std;

int main(){
int f,c;

cout << “This program converts temperature from Fahrenheit to Celsius.” << endl;
cout << “Give me the temperature in Fahrenheit:” << endl;
cin >> f;
cout << “The temperature is ” << f << ” Fahrenheit” << endl;

c = 5*(f-32)/9;
cout <<“The temperature expressed in Celsius is ” << c << ” Celsius” << endl;

if (c >= 100){
cout << “Water boils at this temperature.” << endl;
}
else{
if (c < 0){
cout << “Water is in its solid state, ice.” << endl;
}
else{
cout << “Water, in its solid state, becomes liquid due to its melting point.” << endl;
cout << “Water does not boil at this temperature.” << endl;
}
}
return 0;
}

wsq02-cygwin
Running on Cygwin.

 

wsq02-topics

masterytopics1
Mastery topics involved.

 

 

Until next time.

°Luis Felipe Garate Moreno.

 

Powered by WordPress.com.

Up ↑