From 227aee71b08d5fce3e8a63f0533014814315186e Mon Sep 17 00:00:00 2001 From: Connor McDowell Date: Thu, 25 Jan 2024 18:18:55 -0800 Subject: entering filler --- Project1/header.h | 11 +++++++++ Project1/inclass6.cpp | 62 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 73 insertions(+) (limited to 'Project1') 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 + +#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(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 -- cgit v1.2.3