### Writing a program involving if and else

This is the question

Write a complete program  that inputs an integer  value  from the console representing a temperature in degrees F. Your program  should then output  to the console a "B" if that temperature denotes boiling water (212 or greater), "W" if the water is warm (72 .. 211, inclusive), "C" if the water is cold (33 .. 71) or "F" if the water is frozen (32 or less).
Basically, Im confused on how to state that if T is between 72 and 211, then T= W

the . . does not seem like the correct command/code.

 ``1234567891011121314151617181920212223242526272829`` ``````#include using namespace std; int main() { int T; int B; int W; int C; int F; cin >> T; if (T > 212) { T = B; } if (T = 72..211) { T = W; } if (T = 33..71) { T = C; } if (T < 32) { T = F; } cout << T << endl; } return 0; }``````
Last edited on
Pseudo Code:
If T is Greater Than or Equal to 72 and Less Than or Equal to 211,
Assign W to T.
So something like this

 ``123456789`` `````` If (T >= 72 && T<=211) { T=W; } ``````
Last edited on
Topic archived. No new replies allowed.