summaryrefslogtreecommitdiff
path: root/Project1
diff options
context:
space:
mode:
authorConnor McDowell <[email protected]>2024-01-25 18:18:55 -0800
committerConnor McDowell <[email protected]>2024-01-25 18:18:55 -0800
commit227aee71b08d5fce3e8a63f0533014814315186e (patch)
treebc7f63f7cbad813efcecd9e06db8bdf7047a3170 /Project1
parenttest w open in larger file (diff)
downloadin-class-exercise-6-connormcdowell275-227aee71b08d5fce3e8a63f0533014814315186e.tar.xz
in-class-exercise-6-connormcdowell275-227aee71b08d5fce3e8a63f0533014814315186e.zip
entering filler
Diffstat (limited to 'Project1')
-rw-r--r--Project1/header.h11
-rw-r--r--Project1/inclass6.cpp62
2 files changed, 73 insertions, 0 deletions
diff --git a/Project1/header.h b/Project1/header.h
index 6f70f09..46ecf39 100644
--- a/Project1/header.h
+++ b/Project1/header.h
@@ -1 +1,12 @@
#pragma once
+int returnInt();
+
+int sum(int a, int b);
+
+float percentage(int a, int b);
+
+float FtoC(int fah);
+
+float CtoF(int cel)
+
+# \ No newline at end of file
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