blob: eee0f7906e34cb5bf6d105ed1dc34b03ff2b4dcc (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
// BlankConsoleLab.cpp : This file contains the 'main' function. Program execution begins and ends there.
/*
* Benjamin Smith
* CST116 Lab 2
*/
#include <iostream>
using namespace std;
string input = "";
float temperature = 0;
int main()
{
cout << "Before you input a temperature value, you must first determine if it's in fahrendheit or celcius." << endl;
cout << "Please input 'F' for fahrendheit or 'C' for celcius: ";
cin >> input;
while (input != "F" && input != "C") {
cout << "That input is invalid." << endl;
cout << "Make sure your input is capitalized." << endl;
cout << "Please input 'F' for fahrendheit or 'C' for celcius: ";
cin >> input;
}
}
|