diff options
| author | Connor McDowell <[email protected]> | 2024-01-25 11:33:49 -0800 |
|---|---|---|
| committer | Connor McDowell <[email protected]> | 2024-01-25 11:33:49 -0800 |
| commit | 3e0234c835ac623e259371c75cf6570feedea3ac (patch) | |
| tree | f2ef26b8a72daacf5646017fe6fdb9ec8836a98b /Excersize 5.cpp | |
| parent | add deadline (diff) | |
| download | in-class-exercise-5-connormcdowell275-3e0234c835ac623e259371c75cf6570feedea3ac.tar.xz in-class-exercise-5-connormcdowell275-3e0234c835ac623e259371c75cf6570feedea3ac.zip | |
added excersize 5 into file.
Diffstat (limited to 'Excersize 5.cpp')
| -rw-r--r-- | Excersize 5.cpp | 59 |
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 |