aboutsummaryrefslogtreecommitdiff
path: root/CST116-Lab2-PseudoCode-Preston.txt
diff options
context:
space:
mode:
authorprestonderek <[email protected]>2022-11-06 14:33:35 -0800
committerGitHub <[email protected]>2022-11-06 14:33:35 -0800
commitd7a4fd11d53c7be7646b538f57ff31bf1f3b9501 (patch)
tree59971159e0c7d9b3e9e400d3b445a2720dc1e7ea /CST116-Lab2-PseudoCode-Preston.txt
parentSetting up GitHub Classroom Feedback (diff)
downloadcst116-lab2-prestonderek-d7a4fd11d53c7be7646b538f57ff31bf1f3b9501.tar.xz
cst116-lab2-prestonderek-d7a4fd11d53c7be7646b538f57ff31bf1f3b9501.zip
Add files via upload
VS and GitHub are having trouble communicating. This is the best I can do for a commit right now
Diffstat (limited to 'CST116-Lab2-PseudoCode-Preston.txt')
-rw-r--r--CST116-Lab2-PseudoCode-Preston.txt81
1 files changed, 81 insertions, 0 deletions
diff --git a/CST116-Lab2-PseudoCode-Preston.txt b/CST116-Lab2-PseudoCode-Preston.txt
new file mode 100644
index 0000000..e8b7e6b
--- /dev/null
+++ b/CST116-Lab2-PseudoCode-Preston.txt
@@ -0,0 +1,81 @@
+Pseudocode for Lab 2
+
+float cel
+float far
+float mph
+float chill
+float newFar
+
+const min/max for far, cel, mph
+
+string check
+const string celcheck
+
+float celtofar(cel)
+float getParam(far&, mph&)
+float windchill(far, mph)
+float getMPH(mph&)
+
+main begin
+ far = 0
+ cel = 0
+ mph = 0
+
+ print do you want to enter cel or far
+ input check
+
+ if check == celcheck
+ celtofar(cel)
+ far = newFar
+ getMPH(mph)
+ else
+ getParam(far, mph)
+
+ windchill(far, mph)
+
+ print you entered + far + F
+ print for + far + degrees F and + mph + MPH wind speed + the windchill is + chill
+
+end main funciton
+
+float getParam(float& far, float& mph)
+ print enter far temp
+ print must be between farmin and farmax
+ input far
+ while (far < farmin OR far > farmax)
+ print enter far temp
+ print must be between farmin and farmax
+ input far
+ print enter wind speed in mph
+ print must be between mphmin and mphmax
+ input mph
+ while (mph < mphmin OR mph > mphmax)
+ print enter wind speed in mph
+ print must be between mphmin and mphmax
+ input mph
+ return far, mph
+
+float celtofar(float cel)
+ print enter your cel temp
+ print must be between celmin and celmax
+ input cel
+ while (cel < celmin OR cel > celmax)
+ print enter your cel temp
+ print must be between celmin and celmax
+ input cel
+ newFar = (9/5) x cel + 32
+ return newFar
+
+float getMPH(float& mph)
+ print enter wind speed in mph
+ print must be between mphmin and mphmax
+ input mph
+ while (mph < mphmin OR mph > mphmax)
+ print enter wind speed in mph
+ print must be between mphmin and mphmax
+ input mph
+ return mph
+
+float windchill(float far, float mph)
+ chill = 35.74 + (.6215 * far) - (35.75 * mph^.16) + (.4275 * mph^.16)
+ return chill \ No newline at end of file