From 1147ba66743e8fa60247398c5477fecdf241fccd Mon Sep 17 00:00:00 2001 From: austinlujan Date: Wed, 20 Mar 2024 20:10:57 -0700 Subject: exercise 6 functions implemented and tested --- Project1/program.cpp | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 Project1/program.cpp (limited to 'Project1/program.cpp') diff --git a/Project1/program.cpp b/Project1/program.cpp new file mode 100644 index 0000000..477e05a --- /dev/null +++ b/Project1/program.cpp @@ -0,0 +1,44 @@ + + + +#include + +#include "helpers.h" + + +int main() +{ + std::cout << math_func() << std::endl; + + std::cout << math_func(2) << std::endl; + + std::cout << math_func(2,4) << std::endl; + + std::cout << math_func(5, 7, 8) << std::endl; + + return 0; +} + +int math_func() +{ + + return 1; +} + +int math_func(int square) +{ + + return square * square; +} + +int math_func(int a, int b) +{ + + return a + b; +} + +int math_func(int A, int B, int C, int x) +{ + + return (A * x * x) - (B * x) + C; +} \ No newline at end of file -- cgit v1.2.3