summaryrefslogtreecommitdiff
path: root/Project1/inclass6.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Project1/inclass6.cpp')
-rw-r--r--Project1/inclass6.cpp62
1 files changed, 62 insertions, 0 deletions
diff --git a/Project1/inclass6.cpp b/Project1/inclass6.cpp
index e69de29..211d467 100644
--- a/Project1/inclass6.cpp
+++ b/Project1/inclass6.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() << std::endl;
+ std::cout << FotC(0) << std::endl;
+ std::cout << returnInt() << 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