summaryrefslogtreecommitdiff
path: root/BlankConsoleLab/CST116_Lab2_Williams.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'BlankConsoleLab/CST116_Lab2_Williams.cpp')
-rw-r--r--BlankConsoleLab/CST116_Lab2_Williams.cpp13
1 files changed, 8 insertions, 5 deletions
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 <tuple<string, int, bool> > 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 <tuple<string, int, bool> > 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 <tuple <string, int, bool> > 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 <tuple <string, int, bool> > 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 <tuple <string, int, bool> > 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 <tuple <string, int, bool> > 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 <tuple <string, int, bool> > 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 <tuple <string, int, bool> > 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;
}