I\u00b4m becoming more familiar with the commands of c++, right now i eventually make a programm that can convert from Fahrenheit to Celsius and vice versa.<\/p>\n
It was kind of difficult at first, but once I saw a video about loops and if\u00b4s, well…it was all cleared out for me, now I can ressume my skills acquired in the homework in the following statements:<\/p>\n
-You need to assign a value before the if\u00b4s<\/p>\n
-You need to be careful with the “;”<\/p>\n
-Dont give up!!!<\/p>\n
here\u00b4s the video that help me improve my skills<\/p>\n
https:\/\/www.youtube.com\/watch?v=mSRs9WGrvqA<\/a><\/p>\n <\/p>\n \u00a0<\/p>\n My code:<\/p>\n<\/p>\n <\/p>\n<\/p>\n \u00a0<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":" I´m becoming more familiar with the commands of c++, right now i eventually make a programm that can convert from Fahrenheit to Celsius and vice versa.<\/p>\n It was kind of difficult at first, but once I saw a video about loops and if´s, well…it was all cleared out for me, now I can ressume my skills acquired in the homework in the following statements:<\/p>\n -You need to assign a value before the if´s<\/p>\n -You need to be careful with the “;”<\/p>\n -Dont give up!!!<\/p>\n here´s the video that help me improve my skills<\/p>\n https:\/\/www.youtube.com\/watch?v=mSRs9WGrvqA<\/a><\/p>\n <\/p>\n <\/p>\n My code:<\/p>\n<\/p>\n#include<\/a> <iostream><\/span>
using<\/span> namespace<\/span> std;
int<\/span> main<\/span>(){
\u00a0\u00a0\u00a0 int<\/span> x;
\u00a0\u00a0\u00a0 char<\/span> c;
\u00a0\u00a0\u00a0 cout<<<\/span>\"Choose a convertion\"<\/span><<<\/span>endl;
\u00a0\u00a0\u00a0 cout<<<\/span>\"\"<\/span><<<\/span>endl;
\u00a0\u00a0\u00a0 cout<<<\/span>\"1. Celsius\u00a0 to\u00a0 Fahrenheit\"<\/span><<<\/span>endl;
\u00a0\u00a0\u00a0 cout<<<\/span>\"\"<\/span><<<\/span>endl;
\u00a0\u00a0\u00a0 cout<<<\/span>\"2. Fahrenheit to Celsius\"<\/span><<<\/span>endl;
\u00a0\u00a0\u00a0 cout<<<\/span>\"\"<\/span><<<\/span>endl;
\u00a0\u00a0\u00a0 cin>><\/span>x;
\u00a0\u00a0\u00a0\u00a0 if<\/span>(x==<\/span>1<\/span>){
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 float<\/span> x;
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 cout<<<\/span>\"Enter the temperature in Celsius degrees\"<\/span><<<\/span>endl;
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 cout<<<\/span>\"\"<\/span><<<\/span>endl;
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 cin>><\/span>x;
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 cout<<<\/span>\"\"<\/span><<<\/span>endl;
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 float<\/span> y=<\/span>(x*<\/span>9<\/span>\/<\/span>5<\/span>)+<\/span>(32<\/span>);
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if<\/span> (y<<\/span>212<\/span>){
\u00a0 cout <<<\/span> \"Water does not boil at this temperature (under typical conditions). \"<\/span><<<\/span>endl;
}
if<\/span> (y><\/span>211<\/span>)
{
\u00a0 cout<<<\/span> \"Water does boil at this temperature (under typical conditions). \"<\/span><<<\/span>endl;
}
cout<<<\/span> \"\"<\/span><<<\/span>endl;
if<\/span> (y<<\/span>32<\/span>){
\u00a0 cout<<<\/span> \"The water is frozen\"<\/span><<<\/span> endl;
}
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 cout<<<\/span>x<<<\/span>\" Celsius degrees equals to \"<\/span><<<\/span>y<<<\/span>\" Fahrenheit\"<\/span>;
\u00a0\u00a0\u00a0\u00a0\u00a0 }else<\/span>{
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 float<\/span> a;
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 cout<<<\/span>\"Enter the temperature in fahrenheit degrees \"<\/span><<<\/span>endl;
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 cout<<<\/span>\"\"<\/span><<<\/span>endl;
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 cin>><\/span>a;
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 cout<<<\/span>\"\"<\/span><<<\/span>endl;
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 float<\/span> b=<\/span>(a-<\/span>32<\/span>)*<\/span>5<\/span>\/<\/span>9<\/span>;
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 if<\/span> (b<<\/span>212<\/span>){
\u00a0 cout <<<\/span> \"Water does not boil at this temperature (under typical conditions). \"<\/span><<<\/span>endl;
}
if<\/span> (b><\/span>211<\/span>)
{
\u00a0 cout<<<\/span> \"Water does boil at this temperature (under typical conditions). \"<\/span><<<\/span>endl;
}
cout<<<\/span> \"\"<\/span><<<\/span>endl;
if<\/span> (b<<\/span>33<\/span>){
\u00a0 cout<<<\/span> \"The water is frozen\"<\/span><<<\/span> endl;
}
\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 cout<<<\/span>a<<<\/span>\" Fahrenheit degrees equals to \"<\/span><<<\/span>b<<<\/span>\" Celsius degrees\"<\/span>;
\u00a0\u00a0\u00a0\u00a0\u00a0 }
\u00a0\u00a0 return<\/span> 0<\/span>;
\u00a0\u00a0\u00a0 }
<\/pre>\n<\/div>\n