From 48de5e495fb2076fa6a7fc7db4ba0d8370fcd391 Mon Sep 17 00:00:00 2001 From: Joseph Williams Date: Wed, 9 Nov 2022 11:41:49 -0800 Subject: holy crap everything worked on the first try. that has actually never happened before. --- BlankConsoleLab/CST116_Lab2_Williams.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'BlankConsoleLab/CST116_Lab2_Williams.cpp') diff --git a/BlankConsoleLab/CST116_Lab2_Williams.cpp b/BlankConsoleLab/CST116_Lab2_Williams.cpp index e622b07..48689e4 100644 --- a/BlankConsoleLab/CST116_Lab2_Williams.cpp +++ b/BlankConsoleLab/CST116_Lab2_Williams.cpp @@ -104,7 +104,7 @@ bool isNumber(string str) { // 0: The user entered the temperature in F // 1: The user entered the temperature in C float getTemp(int& unit) { - vector > asktext = {make_tuple("Please enter the current temperature followed by its unit (", 15, 0), make_tuple("[F]ahrenheit", 11, 0), make_tuple(" or ", 15, 0), make_tuple("[C]elcius", 11, 0), make_tuple("): ", 15, 0)}; + vector > asktext = {make_tuple("Please enter the current temperature followed by its unit (", 15, 0), make_tuple("Fahrenheit", 11, 0), make_tuple(" or ", 15, 0), make_tuple("Celcius", 11, 0), make_tuple("): ", 15, 0)}; float temp; while (true) { @@ -271,14 +271,17 @@ int main() kphWind = wind; } - // Calculate the wind chill. The wind chill calculator uses Imperial units and I just convert it to Celcius. + // Calculate the wind chill. The wind chill calculator uses Imperial units, and I just convert it to Celcius. fChill = windChill(fTemp, mphWind); cChill = dftodc(fChill); // Print all the output, using needlessly complicated functions that I'm too stubborn to refine. - vector > tempOut = { make_tuple("The temperature is ", 15, 0), make_tuple(to_string(fTemp) + " degrees Fahrenheit", 11, 0), make_tuple(", or ", 15, 0), make_tuple(to_string(cTemp) + " degrees Celcius", 11, 0), make_tuple(".", 15, 0), }; - vector > windOut = { make_tuple("The wind speed is ", 15, 0), make_tuple(to_string(mphWind) + " miles per hour", 11, 0), make_tuple(", or ", 15, 0), make_tuple(to_string(kphWind) + " kilometers per hour", 11, 0), make_tuple(".", 15, 0), }; - vector > chillOut = { make_tuple("The wind chill is ", 15, 0), make_tuple(to_string(fChill) + " degrees Fahrenheit", 11, 0), make_tuple(", or ", 15, 0), make_tuple(to_string(cChill) + " degrees Celcius", 15, 0), make_tuple(".", 15, 0), }; + vector > tempOut = { make_tuple("The temperature is ", 15, 0), make_tuple(to_string(fTemp) + " degrees Fahrenheit", 11, 0), make_tuple(", or ", 15, 0), make_tuple(to_string(cTemp) + " degrees Celcius", 11, 0), make_tuple(".", 15, 1), }; + vector > windOut = { make_tuple("The wind speed is ", 15, 0), make_tuple(to_string(mphWind) + " miles per hour", 11, 0), make_tuple(", or ", 15, 0), make_tuple(to_string(kphWind) + " kilometers per hour", 11, 0), make_tuple(".", 15, 1), }; + vector > chillOut = { make_tuple("The wind chill is ", 15, 0), make_tuple(to_string(fChill) + " degrees Fahrenheit", 11, 0), make_tuple(", or ", 15, 0), make_tuple(to_string(cChill) + " degrees Celcius", 11, 0), make_tuple(".", 15, 1), }; + multiColorPrint(tempOut); + multiColorPrint(windOut); + multiColorPrint(chillOut); return 0; } -- cgit v1.2.3