aboutsummaryrefslogtreecommitdiff
path: root/Excersize 5.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Excersize 5.cpp')
-rw-r--r--Excersize 5.cpp59
1 files changed, 59 insertions, 0 deletions
diff --git a/Excersize 5.cpp b/Excersize 5.cpp
new file mode 100644
index 0000000..6362e6e
--- /dev/null
+++ b/Excersize 5.cpp
@@ -0,0 +1,59 @@
+// 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;
+
+
+
+}
+
+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