aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiles-Cell <[email protected]>2024-01-29 18:10:02 -0800
committerMiles-Cell <[email protected]>2024-01-29 18:10:26 -0800
commit158761548a53bb32f93bd89dc5668572d3babfc0 (patch)
tree4bd73795d42bfb05084b0f0824349d9f602bcadb
parentinit created (diff)
downloadin-class-exercise-5-miles-cell-158761548a53bb32f93bd89dc5668572d3babfc0.tar.xz
in-class-exercise-5-miles-cell-158761548a53bb32f93bd89dc5668572d3babfc0.zip
Messed up submit. Exercise complete.
-rw-r--r--InClassExercise5/InClassExercise5/Header.h13
-rw-r--r--InClassExercise5/InClassExercise5/InClassExercise5.vcxproj3
-rw-r--r--InClassExercise5/InClassExercise5/InClassExercise5.vcxproj.filters5
-rw-r--r--InClassExercise5/InClassExercise5/Source.cpp39
4 files changed, 55 insertions, 5 deletions
diff --git a/InClassExercise5/InClassExercise5/Header.h b/InClassExercise5/InClassExercise5/Header.h
new file mode 100644
index 0000000..8fb36c1
--- /dev/null
+++ b/InClassExercise5/InClassExercise5/Header.h
@@ -0,0 +1,13 @@
+#ifndef MY_HELPERS_H
+#define MY_HELPERS_H
+
+double double_function(double& new_var);
+char char_function();
+size_t array_size();
+void no_return();
+
+
+
+#endif MY_HELPERS_H
+
+
diff --git a/InClassExercise5/InClassExercise5/InClassExercise5.vcxproj b/InClassExercise5/InClassExercise5/InClassExercise5.vcxproj
index a6a441f..d968d92 100644
--- a/InClassExercise5/InClassExercise5/InClassExercise5.vcxproj
+++ b/InClassExercise5/InClassExercise5/InClassExercise5.vcxproj
@@ -129,6 +129,9 @@
<ItemGroup>
<ClCompile Include="Source.cpp" />
</ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="Header.h" />
+ </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">
</ImportGroup>
diff --git a/InClassExercise5/InClassExercise5/InClassExercise5.vcxproj.filters b/InClassExercise5/InClassExercise5/InClassExercise5.vcxproj.filters
index 3e7e62e..25c729c 100644
--- a/InClassExercise5/InClassExercise5/InClassExercise5.vcxproj.filters
+++ b/InClassExercise5/InClassExercise5/InClassExercise5.vcxproj.filters
@@ -19,4 +19,9 @@
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
+ <ItemGroup>
+ <ClInclude Include="Header.h">
+ <Filter>Header Files</Filter>
+ </ClInclude>
+ </ItemGroup>
</Project> \ No newline at end of file
diff --git a/InClassExercise5/InClassExercise5/Source.cpp b/InClassExercise5/InClassExercise5/Source.cpp
index 0e10e7c..a560d6d 100644
--- a/InClassExercise5/InClassExercise5/Source.cpp
+++ b/InClassExercise5/InClassExercise5/Source.cpp
@@ -3,22 +3,51 @@
// Class: CST 116
// Assignment: InClass Exercise 5
-double doubleFunction() {
- return 5.36;
-}
+#include <iostream>
-int main()
+#include "Header.h"
+
+
+
+double double_function(double& new_var)
{
+ double var = new_var*2;
+ new_var = var;
+ return var;
+}
- return 0;
+char char_function()
+{
+ return 'y';
}
+size_t array_size()
+{
+ return 631635416354;
+}
+
+void no_return()
+{
+ std::cout << "This does not return anything";
+}
+int main()
+{
+ //no_return();
+ //array_size();
+ //char c = char_function();
+ double new_var = 5.7896;
+ double new_double = double_function(new_var);
+ std::cout << new_double << std::endl;
+ std::cout << new_var << std::endl;
+
+ return 0;
+} \ No newline at end of file