From 036bfeeda7af4eca50cdaef0d5a7de61232f4965 Mon Sep 17 00:00:00 2001 From: Fennel Kora <99110900+fencore@users.noreply.github.com> Date: Thu, 1 Jun 2023 11:44:30 -0400 Subject: [PATCH] Add project files. --- Project1/Project1.cpp | 39 +++++++++ Project1/Project1.sln | 31 +++++++ Project1/Project1.vcxproj | 135 ++++++++++++++++++++++++++++++ Project1/Project1.vcxproj.filters | 22 +++++ Project2/Project2.cpp | 61 ++++++++++++++ Project2/Project2.sln | 31 +++++++ Project2/Project2.vcxproj | 135 ++++++++++++++++++++++++++++++ Project2/Project2.vcxproj.filters | 22 +++++ 8 files changed, 476 insertions(+) create mode 100644 Project1/Project1.cpp create mode 100644 Project1/Project1.sln create mode 100644 Project1/Project1.vcxproj create mode 100644 Project1/Project1.vcxproj.filters create mode 100644 Project2/Project2.cpp create mode 100644 Project2/Project2.sln create mode 100644 Project2/Project2.vcxproj create mode 100644 Project2/Project2.vcxproj.filters diff --git a/Project1/Project1.cpp b/Project1/Project1.cpp new file mode 100644 index 0000000..c190607 --- /dev/null +++ b/Project1/Project1.cpp @@ -0,0 +1,39 @@ +// Project1.cpp + +#include +#include + +using namespace std; + +int sumArr(int arr[]) { + int i = 0; + for (int* p = arr; *p <= *(arr + sizeof(arr)) + sizeof(int); p++) { + i += *p; + } + return i; +} + +vector onlyEven(int arr[]) { + vector evenArr; + for (int* p = arr; *p <= *(arr + sizeof(arr)) + sizeof(int); p++) { + if (*p % 2 == 0) { + evenArr.push_back(*p); + } + } + return evenArr; +} + +int main() +{ + int numArr[10] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; + int sum = sumArr(numArr); + cout << sum << endl; + + vector newArr = onlyEven(numArr); + for (int i : newArr) { + cout << i << endl; + } +} + +// Run program: Ctrl + F5 or Debug > Start Without Debugging menu +// Debug program: F5 or Debug > Start Debugging menu diff --git a/Project1/Project1.sln b/Project1/Project1.sln new file mode 100644 index 0000000..64e9a6b --- /dev/null +++ b/Project1/Project1.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.6.33712.159 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Project1", "Project1.vcxproj", "{33FA9684-0033-4684-82D5-548F21F4ED10}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {33FA9684-0033-4684-82D5-548F21F4ED10}.Debug|x64.ActiveCfg = Debug|x64 + {33FA9684-0033-4684-82D5-548F21F4ED10}.Debug|x64.Build.0 = Debug|x64 + {33FA9684-0033-4684-82D5-548F21F4ED10}.Debug|x86.ActiveCfg = Debug|Win32 + {33FA9684-0033-4684-82D5-548F21F4ED10}.Debug|x86.Build.0 = Debug|Win32 + {33FA9684-0033-4684-82D5-548F21F4ED10}.Release|x64.ActiveCfg = Release|x64 + {33FA9684-0033-4684-82D5-548F21F4ED10}.Release|x64.Build.0 = Release|x64 + {33FA9684-0033-4684-82D5-548F21F4ED10}.Release|x86.ActiveCfg = Release|Win32 + {33FA9684-0033-4684-82D5-548F21F4ED10}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {8EFDD006-E504-44B1-B593-A15517DDF96E} + EndGlobalSection +EndGlobal diff --git a/Project1/Project1.vcxproj b/Project1/Project1.vcxproj new file mode 100644 index 0000000..6187950 --- /dev/null +++ b/Project1/Project1.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {33fa9684-0033-4684-82d5-548f21f4ed10} + Project1 + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/Project1/Project1.vcxproj.filters b/Project1/Project1.vcxproj.filters new file mode 100644 index 0000000..b59e52e --- /dev/null +++ b/Project1/Project1.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + \ No newline at end of file diff --git a/Project2/Project2.cpp b/Project2/Project2.cpp new file mode 100644 index 0000000..fae749f --- /dev/null +++ b/Project2/Project2.cpp @@ -0,0 +1,61 @@ +//Corey Williams +//COP3530 01Z +//Project 2 +/* + Prompt the user for 5 integer values + Stores the elements in a vector + Displays the sorted elements + Displays the smallest element + Displays the largest element + Displays the total of all elements + Displays the average of all the elements +*/ + +#include +#include + +using namespace std; + +int main() +{ + vector userInputs; + int repFlag; + int sum = 0; + + //Loops to collect 5 integers from user and pushes to vector + for (int i = 1; i < 6; i++) { + int x; + cout << "Input Integer " << i << ": "; + cin >> x; + userInputs.push_back(x); + } + + //Iterates through vector to order from smallest to largest + //Repflag is used to repeat iteration through the vector until no new changes are made. + do { + repFlag = 0; + for (vector::iterator i = userInputs.begin(); i + 1 != userInputs.end(); ++i) { + if (*i > *(i + 1)) { + int tmp = *i; + *i = *(i + 1); + *(i + 1) = tmp; + repFlag = 1; + } + } + } while (repFlag == 1); + + //Iterates through sorted vector to print in ascending order, also collects sum for later use + cout << endl << "Ordered: "; + for (int i : userInputs) { + cout << i << " "; + sum += i; + } + cout << endl; + + cout << "Smallest: " << userInputs.front() << endl; + cout << "Largest: " << userInputs.back() << endl; + cout << "Total: " << sum << endl; + cout << "Average: " << sum / 5 << endl; + + return 0; +} \ No newline at end of file diff --git a/Project2/Project2.sln b/Project2/Project2.sln new file mode 100644 index 0000000..30b89aa --- /dev/null +++ b/Project2/Project2.sln @@ -0,0 +1,31 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.6.33723.286 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Project2", "Project2.vcxproj", "{FE1B3D7C-229D-4B04-947A-EB71494B497B}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|x64 = Debug|x64 + Debug|x86 = Debug|x86 + Release|x64 = Release|x64 + Release|x86 = Release|x86 + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {FE1B3D7C-229D-4B04-947A-EB71494B497B}.Debug|x64.ActiveCfg = Debug|x64 + {FE1B3D7C-229D-4B04-947A-EB71494B497B}.Debug|x64.Build.0 = Debug|x64 + {FE1B3D7C-229D-4B04-947A-EB71494B497B}.Debug|x86.ActiveCfg = Debug|Win32 + {FE1B3D7C-229D-4B04-947A-EB71494B497B}.Debug|x86.Build.0 = Debug|Win32 + {FE1B3D7C-229D-4B04-947A-EB71494B497B}.Release|x64.ActiveCfg = Release|x64 + {FE1B3D7C-229D-4B04-947A-EB71494B497B}.Release|x64.Build.0 = Release|x64 + {FE1B3D7C-229D-4B04-947A-EB71494B497B}.Release|x86.ActiveCfg = Release|Win32 + {FE1B3D7C-229D-4B04-947A-EB71494B497B}.Release|x86.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {E8DA889D-1B97-4CFB-8DFE-A3F298F71100} + EndGlobalSection +EndGlobal diff --git a/Project2/Project2.vcxproj b/Project2/Project2.vcxproj new file mode 100644 index 0000000..1797066 --- /dev/null +++ b/Project2/Project2.vcxproj @@ -0,0 +1,135 @@ + + + + + Debug + Win32 + + + Release + Win32 + + + Debug + x64 + + + Release + x64 + + + + 16.0 + Win32Proj + {fe1b3d7c-229d-4b04-947a-eb71494b497b} + Project2 + 10.0 + + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + Application + true + v143 + Unicode + + + Application + false + v143 + true + Unicode + + + + + + + + + + + + + + + + + + + + + + Level3 + true + WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + Level3 + true + _DEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + + + + + Level3 + true + true + true + NDEBUG;_CONSOLE;%(PreprocessorDefinitions) + true + + + Console + true + true + true + + + + + + + + + \ No newline at end of file diff --git a/Project2/Project2.vcxproj.filters b/Project2/Project2.vcxproj.filters new file mode 100644 index 0000000..e7c8922 --- /dev/null +++ b/Project2/Project2.vcxproj.filters @@ -0,0 +1,22 @@ + + + + + {4FC737F1-C7A5-4376-A066-2A32D752A2FF} + cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx + + + {93995380-89BD-4b04-88EB-625FBE52EBFB} + h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd + + + {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} + rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms + + + + + Source Files + + + \ No newline at end of file