please can you write a professional comment using the // command for this c++ code thank you #include using namespace std; int main () { char letter; // Place to store input letter int tempIn; // Temperature to be converted int tempOut; // Converted temperature cout << "Input Menu" << endl << endl; cout << "F: Convert from Fahrenheit to Celsius" << endl; cout << "C: Convert from Celsius to Fahrenheit" << endl; cout << "Type a C or an F, then press return." << endl << endl; cout << "Enter your option: "; cin >> letter; // C ,c, f or F { if(letter!='C'||letter!='c'||letter!='F'||letter!='f') cout <<"wrong letter" <> tempIn; if (letter == 'C') tempOut = (9 * tempIn / 5) + 32; else tempOut = 5 * (tempIn - 32) / 9; cout << endl << endl; cout << "Temperature to convert: " << tempIn << endl; cout << "Converted temperature: " << tempOut << endl; return 0; }
Addition of Two Numbers
Adding two numbers in programming is essentially the same as adding two numbers in general arithmetic. A significant difference is that in programming, you need to pay attention to the data type of the variable that will hold the sum of two numbers.
C++
C++ is a general-purpose hybrid language, which supports both OOPs and procedural language designed and developed by Bjarne Stroustrup. It began in 1979 as “C with Classes” at Bell Labs and first appeared in the year 1985 as C++. It is the superset of C programming language, because it uses most of the C code syntax. Due to its hybrid functionality, it used to develop embedded systems, operating systems, web browser, GUI and video games.
please can you write a professional comment using the // command for this c++ code thank you
#include <iostream>
using namespace std;
int main ()
{
char letter; // Place to store input letter
int tempIn; // Temperature to be converted
int tempOut; // Converted temperature
cout << "Input Menu" << endl << endl;
cout << "F: Convert from Fahrenheit to Celsius" << endl;
cout << "C: Convert from Celsius to Fahrenheit" << endl;
cout << "Type a C or an F, then press return." << endl << endl;
cout << "Enter your option: ";
cin >> letter; // C ,c, f or F
{
if(letter!='C'||letter!='c'||letter!='F'||letter!='f')
cout <<"wrong letter" <<endl;
}
cout <<"Type an integer number: ";
cin >> tempIn;
if (letter == 'C')
tempOut = (9 * tempIn / 5) + 32;
else
tempOut = 5 * (tempIn - 32) / 9;
cout << endl << endl;
cout << "Temperature to convert: " << tempIn << endl;
cout << "Converted temperature: " << tempOut << endl;
return 0;
}

Step by step
Solved in 4 steps with 3 images









