From 5b1b297815f5d88e1ed594af7c1e7e3d4bc8f83a Mon Sep 17 00:00:00 2001 From: "smithbenjamin2022@gmail.com" Date: Wed, 9 Nov 2022 14:27:44 -0800 Subject: Initial Inputs --- BlankConsoleLab/BlankConsoleLab.cpp | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'BlankConsoleLab/BlankConsoleLab.cpp') diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp index ed5f807..eee0f79 100644 --- a/BlankConsoleLab/BlankConsoleLab.cpp +++ b/BlankConsoleLab/BlankConsoleLab.cpp @@ -1,16 +1,25 @@ // BlankConsoleLab.cpp : This file contains the 'main' function. Program execution begins and ends there. -// +/* +* Benjamin Smith +* CST116 Lab 2 +*/ #include using namespace std; -using std::cout; -using std::cin; -using std::endl; +string input = ""; +float temperature = 0; int main() { - cout << "Hello World!\n"; -} - + 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; + } +} \ No newline at end of file -- cgit v1.2.3