From 1437e0dcee0b2382f148f23a4a2d7b928fa37de3 Mon Sep 17 00:00:00 2001 From: "Thien K. M. Bui" Date: Tue, 25 Jan 2022 21:16:03 -0600 Subject: [PATCH] added temperature.c --- assignment7-starter/collaboration.txt | 1 + assignment7-starter/temperature | Bin 0 -> 16520 bytes assignment7-starter/temperature.c | 20 ++++++++++++++++++++ 3 files changed, 21 insertions(+) create mode 100644 assignment7-starter/collaboration.txt create mode 100755 assignment7-starter/temperature create mode 100644 assignment7-starter/temperature.c diff --git a/assignment7-starter/collaboration.txt b/assignment7-starter/collaboration.txt new file mode 100644 index 0000000..142ac98 --- /dev/null +++ b/assignment7-starter/collaboration.txt @@ -0,0 +1 @@ +I did not consult with anyone else on this assignment, all code found in this folder, with the exception of test_m.py, is written by Thien K. M. Bui \ No newline at end of file diff --git a/assignment7-starter/temperature b/assignment7-starter/temperature new file mode 100755 index 0000000000000000000000000000000000000000..12c37c4d203c2eee32bfd589753ed2943c5a054e GIT binary patch literal 16520 zcmeHOYitzP6~4P`p_srehJG=M(u(P|%?Q$^^H`~ro+Z&KMWxX<{v~pE&Eo?rM z**DlqHV2p*xMW^~Xq5=#ZmWXOE9^Xg=yy)kpL5Hgp)MmpWJ?IChluD`5?K^2d|gx$ zvVc{MezjN>Iuqj~{E6rXA=wq%lh7GNk~t8*B|1h}?uWSv1TFKxcFT{jQM4BlNPeiI zpCtSw;YT3WlS}x87a22JJQy! zZVYZMmNo{rfZaecof38`wC3hx#~h%zK*RCVeOhK13o%2R1eaTG%tfDVXbdvBL*|Hc zfO3e$bQw>vk#CS?1Xc$ZwnHM7@ie!n&Os*wP6nI|I2mv<;AFtbfRh0y15O4WZU(0O z-~2*3{;5}ax%TFIc+7uc)N~idmE&XHOT3}NmXCohti1uR{#7!RP>*BX&Fck_wI8C6 zOZuDRpkllY|BB?_KceJ6R*v78+}jhmJbG-A%#_O)0~{{P^$=%i2K?@xLHkSnLI0`~ zyty+MTHt{|*@my?;tR-Om*$QjQMlfJ=2Cy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ykp`VX`0}V$jrwpo}vG>e4*p zK|L2S$x+Y-?mc38@*CMWy;jIMU z0hZ8uht5aRI$2b6TPh=d8!lX%l0U7B=se&WG%6GN{2{6t3g!N^ewq*gB{CFf_wNAy z->{aY_Gz8v6$@_aKYd<#ZSi)4j%#=Fr}bE)@E;QPa{w_<WlztkWG~V}DmyFui_J)~ zRVP{Sk_E+A%0Ch3pn&5i|I#^H%i?h|6lib%H^7(s(|Y@gWI0R-KLUIEqfmisR54wP z>vB40Yquwz@ICN_)k)Exp3fVCK!T8+rImEzKY$9HJJdd{59u89I1Ubk<`?+#Q<`P8nRU0S5f3p53kky+gmIv&wug%594imO#lD@ literal 0 HcmV?d00001 diff --git a/assignment7-starter/temperature.c b/assignment7-starter/temperature.c new file mode 100644 index 0000000..bbddcac --- /dev/null +++ b/assignment7-starter/temperature.c @@ -0,0 +1,20 @@ +/*temperature.c +Written by Thien K. M. Bui +Last modified 01-25-22 +*/ + +#include + +int main() { + float input; + printf("What is the temperature in degrees Fahrenheit? "); + scanf("%f", &input); + + if (input <= -459.67){ + printf("Invalid temperature!\n"); + }else{ + float temp_celsius = (input - 32) * 5/9; + printf("%f degrees Fahrenheit is %f Celsius\n", input, temp_celsius); + } + return 0; +}