diff options
| author | Taylor Rogers <[email protected]> | 2022-11-08 09:03:36 -0800 |
|---|---|---|
| committer | Taylor Rogers <[email protected]> | 2022-11-08 09:03:36 -0800 |
| commit | 871c1ab2c996ed62efed9e1fa1276ec1985aff08 (patch) | |
| tree | da4f73d490ab68139c04a6bed7cd8ae8a7379a71 | |
| parent | syntax errors (diff) | |
| download | cst116-lab2-taylorrog-871c1ab2c996ed62efed9e1fa1276ec1985aff08.tar.xz cst116-lab2-taylorrog-871c1ab2c996ed62efed9e1fa1276ec1985aff08.zip | |
Add pseudo-code file
| -rw-r--r-- | BlankConsoleLab/BlankConsoleLab.cpp | 3 | ||||
| -rw-r--r-- | BlankConsoleLab/BlankConsoleLab.vcxproj | 3 | ||||
| -rw-r--r-- | BlankConsoleLab/BlankConsoleLab.vcxproj.filters | 3 | ||||
| -rw-r--r-- | BlankConsoleLab/CST116-Lab2-Pseudo-code-Rogers.txt | 31 |
4 files changed, 40 insertions, 0 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp index 7792c9f..607525d 100644 --- a/BlankConsoleLab/BlankConsoleLab.cpp +++ b/BlankConsoleLab/BlankConsoleLab.cpp @@ -13,13 +13,16 @@ // 3. If [Tunit] = F is selected: // 1. Print "Enter temperature value between -80 and 121 degrees Fahreneit" // 2. Input [TvalF] +// 3. Clamp TvalF to limits // 4. If [Tunit] = C is selected: // 1. Print "Enter temperature value between -52 and 49.5 degrees Celsius" // 2. Input [TvalC] +// 3. Clamp TvalC to limits // 6. Print "Enter a wind speed, in miles per hour, between 0 and 231" // 1. Declare constant [Wmax] = 231 // 2. Declare constant [Wmin] = 0 // 3. Input [Wspeed] +// 4. Clamp Wspeed to limits // 7. F input function: // 1. Declare [FtoCval] = ( [TvalF] - 32 ) * ( 5 / 9 ) // 2. [TvalC] = [FtoCval] diff --git a/BlankConsoleLab/BlankConsoleLab.vcxproj b/BlankConsoleLab/BlankConsoleLab.vcxproj index d2e3ee2..74917a4 100644 --- a/BlankConsoleLab/BlankConsoleLab.vcxproj +++ b/BlankConsoleLab/BlankConsoleLab.vcxproj @@ -141,6 +141,9 @@ <ItemGroup> <ClCompile Include="BlankConsoleLab.cpp" /> </ItemGroup> + <ItemGroup> + <Text Include="CST116-Lab2-Pseudo-code-Rogers.txt" /> + </ItemGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <ImportGroup Label="ExtensionTargets"> </ImportGroup> diff --git a/BlankConsoleLab/BlankConsoleLab.vcxproj.filters b/BlankConsoleLab/BlankConsoleLab.vcxproj.filters index aca1dd9..6ab38b0 100644 --- a/BlankConsoleLab/BlankConsoleLab.vcxproj.filters +++ b/BlankConsoleLab/BlankConsoleLab.vcxproj.filters @@ -19,4 +19,7 @@ <Filter>Source Files</Filter> </ClCompile> </ItemGroup> + <ItemGroup> + <Text Include="CST116-Lab2-Pseudo-code-Rogers.txt" /> + </ItemGroup> </Project>
\ No newline at end of file diff --git a/BlankConsoleLab/CST116-Lab2-Pseudo-code-Rogers.txt b/BlankConsoleLab/CST116-Lab2-Pseudo-code-Rogers.txt new file mode 100644 index 0000000..b0e5139 --- /dev/null +++ b/BlankConsoleLab/CST116-Lab2-Pseudo-code-Rogers.txt @@ -0,0 +1,31 @@ +// Pseudo Code: +// 1. Print "Please enter F for Fahrenheit, or C for Celsius" +// 1. Declare constant [Fmax] = 121 +// 2. Declare constant [Fmin] = -80 +// 3. Declare constant [Cmax] = 49.5 +// 4. Declare constant [Cmin] = -62 +// 2. Input [Tunit] +// 3. If [Tunit] = F is selected: +// 1. Print "Enter temperature value between -80 and 121 degrees Fahreneit" +// 2. Input [TvalF] +// 3. Clamp TvalF to limits +// 4. If [Tunit] = C is selected: +// 1. Print "Enter temperature value between -52 and 49.5 degrees Celsius" +// 2. Input [TvalC] +// 3. Clamp TvalC to limits +// 6. Print "Enter a wind speed, in miles per hour, between 0 and 231" +// 1. Declare constant [Wmax] = 231 +// 2. Declare constant [Wmin] = 0 +// 3. Input [Wspeed] +// 4. Clamp Wspeed to limits +// 7. F input function: +// 1. Declare [FtoCval] = ( [TvalF] - 32 ) * ( 5 / 9 ) +// 2. [TvalC] = [FtoCval] +// 8. C input function: +// 1. Declare [CtoFval] = (9 / 5 ) * [TvalC] + 32 +// 2. [TvalF] = [CtoFval] +// 9. Windchill function: +// 1. [Wchill] = 35.74 + .6215 * [TvalF] - 35.75 * ( [Wspeed] ^ 0.16 ) + 0.4275 * [TvalF] * ( [Wspeed] ^ 0.16 ) +// 10. Print headers "Temperature in F" , "Temperature in C", "Windpseed", "Windchill" +// 11. Print [TvalF] , [TvalC] , [Wspeed] , [Wchill] +//
\ No newline at end of file |