summaryrefslogtreecommitdiff
path: root/BlankConsoleLab
diff options
context:
space:
mode:
Diffstat (limited to 'BlankConsoleLab')
-rw-r--r--BlankConsoleLab/CST116-Lab2-Ahmed.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/BlankConsoleLab/CST116-Lab2-Ahmed.cpp b/BlankConsoleLab/CST116-Lab2-Ahmed.cpp
index 3d38d16..4e7f9dc 100644
--- a/BlankConsoleLab/CST116-Lab2-Ahmed.cpp
+++ b/BlankConsoleLab/CST116-Lab2-Ahmed.cpp
@@ -4,6 +4,7 @@
#include <iostream>
#include <string>
#include <iomanip>
+#include <sstream>
using std::string;
@@ -20,6 +21,7 @@ float cToF(float a) {
}
// Function name windChill, inputs a float d, w, and boolean x by reference, returns a float out
float windChill(float& d, float& w, bool& x) {
+
float out;
if (x == false) {
out = 35.74 + 0.6215 * cToF(d) - 35.75 * pow(w, 0.16) + 0.4275 * cToF(d) * pow(w, 0.16);
@@ -31,6 +33,8 @@ float windChill(float& d, float& w, bool& x) {
}
// Function name output, inputs floats d, w, chill, and boolean x, returns a string containing the complete output
string output(float d, float w, float chill, bool x) {
+ std::ostringstream ss;
+ ss.precision(3);
string temp;
if (x == true) {