diff options
| author | rPatrickWarner <[email protected]> | 2024-01-22 19:20:24 -0800 |
|---|---|---|
| committer | rPatrickWarner <[email protected]> | 2024-01-22 19:20:24 -0800 |
| commit | 7283677ad210739ce56d332c6d57c20b7f111ef6 (patch) | |
| tree | 0a5e58b9de559c0576b5c3f74785196d710e9c84 /InClassExercise5ReeceW | |
| parent | init (diff) | |
| download | in-class-exercise-5-reecepwarner-7283677ad210739ce56d332c6d57c20b7f111ef6.tar.xz in-class-exercise-5-reecepwarner-7283677ad210739ce56d332c6d57c20b7f111ef6.zip | |
inclassexercise5
Diffstat (limited to 'InClassExercise5ReeceW')
4 files changed, 95 insertions, 21 deletions
diff --git a/InClassExercise5ReeceW/InClassExercise5ReeceW/IC5Header.h b/InClassExercise5ReeceW/InClassExercise5ReeceW/IC5Header.h index cd965b0..5d9ed1b 100644 --- a/InClassExercise5ReeceW/InClassExercise5ReeceW/IC5Header.h +++ b/InClassExercise5ReeceW/InClassExercise5ReeceW/IC5Header.h @@ -1,6 +1,16 @@ #ifndef InClass5 #define InClass5 +int returnInt(); +int sum(int a, int b); -#endif InClass5 +float percentage(int a, int b); + +float fToc(int fah); + +float cTof(int cel); + + + +#endif //InClass5 diff --git a/InClassExercise5ReeceW/InClassExercise5ReeceW/InClassExercise5ReeceW.vcxproj b/InClassExercise5ReeceW/InClassExercise5ReeceW/InClassExercise5ReeceW.vcxproj index 3fcbcd7..31cb54d 100644 --- a/InClassExercise5ReeceW/InClassExercise5ReeceW/InClassExercise5ReeceW.vcxproj +++ b/InClassExercise5ReeceW/InClassExercise5ReeceW/InClassExercise5ReeceW.vcxproj @@ -17,7 +17,6 @@ <Configuration>Release</Configuration> <Platform>x64</Platform> </ProjectConfiguration> - </ItemGroup> <PropertyGroup Label="Globals"> <VCProjectVersion>17.0</VCProjectVersion> @@ -53,27 +52,24 @@ <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> - <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> </ImportGroup> - <ImportGroup Label="Shared" > + <ImportGroup Label="Shared"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - </ImportGroup> - <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> - <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> - </ImportGroup> - <PropertyGroup Label="UserMacros" /> - <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ClCompile> <WarningLevel>Level3</WarningLevel> @@ -130,9 +126,13 @@ <GenerateDebugInformation>true</GenerateDebugInformation> </Link> </ItemDefinitionGroup> - - <ItemGroup></ItemGroup> + <ItemGroup> + <ClCompile Include="Source.cpp" /> + </ItemGroup> + <ItemGroup> + <ClInclude Include="IC5Header.h" /> + </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> </ImportGroup> -</Project> +</Project>
\ No newline at end of file diff --git a/InClassExercise5ReeceW/InClassExercise5ReeceW/InClassExercise5ReeceW.vcxproj.filters b/InClassExercise5ReeceW/InClassExercise5ReeceW/InClassExercise5ReeceW.vcxproj.filters index a8a6563..fc5a03b 100644 --- a/InClassExercise5ReeceW/InClassExercise5ReeceW/InClassExercise5ReeceW.vcxproj.filters +++ b/InClassExercise5ReeceW/InClassExercise5ReeceW/InClassExercise5ReeceW.vcxproj.filters @@ -14,4 +14,14 @@ <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> </Filter> </ItemGroup> + <ItemGroup> + <ClCompile Include="Source.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + </ItemGroup> + <ItemGroup> + <ClInclude Include="IC5Header.h"> + <Filter>Header Files</Filter> + </ClInclude> + </ItemGroup> </Project>
\ No newline at end of file diff --git a/InClassExercise5ReeceW/InClassExercise5ReeceW/Source.cpp b/InClassExercise5ReeceW/InClassExercise5ReeceW/Source.cpp index d260cb7..c757bcf 100644 --- a/InClassExercise5ReeceW/InClassExercise5ReeceW/Source.cpp +++ b/InClassExercise5ReeceW/InClassExercise5ReeceW/Source.cpp @@ -13,8 +13,62 @@ using std::endl; int main() { + sum(15, 30); + cout << sum(15,30) << endl; + cout << returnInt() << endl; + cout << percentage(10, 100) << "%" << endl; + cout << percentage(20, 100) << "%"<< endl; + cout << percentage(30, 100) << "%"<< endl; + cout << percentage(40, 100) << "%"<< endl; + int i; + cout << "give me a number" << endl; + + cin >> i; + + cout << fToc(i) << endl; + cout << cTof(i) << endl; return 0; } + + +int returnInt() +{ + return 10; + +} + +int sum(int a, int b) +{ + int sum = 0; + + sum = a + b; + + return sum; +} + +float percentage(int a, int b) +{ + float perc = (static_cast<float>(a) / b) * 100; + + + return perc; +} + +float fToc(int fah) +{ + float numb = (fah - 32) * (5 / 9); + + return numb; +} + +float cTof(int cel) +{ + float num = (cel * (9.0 / 5)) + 32; + + + return num; +} + |