summaryrefslogtreecommitdiff
path: root/Excersize 6.cpp
diff options
context:
space:
mode:
authorConnor McDowell <[email protected]>2024-01-25 17:29:19 -0800
committerConnor McDowell <[email protected]>2024-01-25 17:29:19 -0800
commit85611adab2f5cad292523582797a656a6f96497c (patch)
treee2e102254e99f3baa7a2f5cbf5569c0832042d8f /Excersize 6.cpp
parentadd deadline (diff)
downloadarchived-in-class-exercise-6-connormcdowell275-85611adab2f5cad292523582797a656a6f96497c.tar.xz
archived-in-class-exercise-6-connormcdowell275-85611adab2f5cad292523582797a656a6f96497c.zip
staging using excersize five as template
Diffstat (limited to 'Excersize 6.cpp')
-rw-r--r--Excersize 6.cpp62
1 files changed, 62 insertions, 0 deletions
diff --git a/Excersize 6.cpp b/Excersize 6.cpp
new file mode 100644
index 0000000..29b82e5
--- /dev/null
+++ b/Excersize 6.cpp
@@ -0,0 +1,62 @@
+// Name: Connor McDowell
+// Date: 1/22/2024
+// Class: CST116
+// Assignment: exercise 5
+
+#include <iostream>
+
+#include "helper.h"
+
+int main()
+{
+ int mySum = sum(15, 30);
+
+ std::cout << mySum << std::endl;
+
+ std::cout << returnInt() << std::endl;
+
+ std::cout << percentage(40, 78) << std::endl;
+ std::cout << FtoC(56) << std::endl;
+ std::cout << CtoF(120) << std::endl;
+}
+
+int returnInt()
+{
+
+ return 10;
+}
+
+int sum(int a, int b)
+{
+ int sum = 0;
+ sum = a + b;
+
+ return sum;
+}
+
+float percentage(int a, int b)
+{
+ int perc = 0;
+ perc = (static_cast<float>(a) / b) * 100;
+
+ return perc;
+}
+
+
+float FtoC(int fah)
+{
+ // -32*5/9
+
+ float num = (fah - 32) * (5 / 9);
+
+ return num;
+}
+
+float CtoF(int cel)
+{
+ // 9/5+32
+
+ float num = (cel * (9.0 / 5.0)) + 32;
+
+ return num;
+} \ No newline at end of file