diff options
| -rw-r--r-- | BlankConsoleLab/CST116 -Lab2-Hill.cpp | 4 | ||||
| -rw-r--r-- | BlankConsoleLab/CST116-Lab2-Flowchart.txt | 12 |
2 files changed, 13 insertions, 3 deletions
diff --git a/BlankConsoleLab/CST116 -Lab2-Hill.cpp b/BlankConsoleLab/CST116 -Lab2-Hill.cpp index 81d82ec..6e96b6d 100644 --- a/BlankConsoleLab/CST116 -Lab2-Hill.cpp +++ b/BlankConsoleLab/CST116 -Lab2-Hill.cpp @@ -69,9 +69,9 @@ float GetWindChill() { int main() { - char choice = 'n'; + char choice = 'Y'; - while (choice != 'Y') { + while (choice == 'Y') { cout << "Please enter a temperature between -80 to 121 degrees fahrenheit, or -62 and 49.5 degrees celsius." << endl; cout << "Example entries: -32.3 F, 27.8 C\n" << endl; diff --git a/BlankConsoleLab/CST116-Lab2-Flowchart.txt b/BlankConsoleLab/CST116-Lab2-Flowchart.txt index 58171d1..169fbf3 100644 --- a/BlankConsoleLab/CST116-Lab2-Flowchart.txt +++ b/BlankConsoleLab/CST116-Lab2-Flowchart.txt @@ -65,6 +65,11 @@ DEFINE FUNCTION THAT RETURNS A FLOAT VALUE GetWindChill(){ MAIN PROGRAM(){ + INITIALIZE CHAR choice TO BE 'Y' + + WHILE choice IS Y, DO THIS { + + PRINT "Please enter a temperature between -80 to 121 degrees fahrenheit, or -62 and 49.5 degrees celsius."; PRINT "Example entries: -32.3 F, 27.8 C"; @@ -124,9 +129,14 @@ MAIN PROGRAM(){ SET windChillCelsius TO RETURN VALUE FROM ConvertTemperature WITH PARAMETERS windChillFahrenheit AND 'F'; PRINT "Conversions for [TEMPERATURE INPUTTED BY USER] with wind speed [WIND SPEED ENTERED BY USER]MPH."; - PRINT [FORMATTED TABLE WITH HEADERS FOR TEMPERATURE IN CELSIUS AND FAHRENHEIT, WIND SPEED, AND CALCULATED WIND CHILL]; + PRINT "If you would like to input another set of data, please enter 'Y'"; + + SET choice TO INPUT; + + } + END PROGRAM; }
\ No newline at end of file |