{\rtf1\ansi\ansicpg1252\cocoartf2639 \cocoatextscaling0\cocoaplatform0{\fonttbl\f0\fswiss\fcharset0 Helvetica;\f1\fnil\fcharset0 Menlo-Regular;\f2\fnil\fcharset0 Menlo-Bold; } {\colortbl;\red255\green255\blue255;\red252\green106\blue93;\red31\green31\blue36;\red230\green255\blue218; \red255\green255\blue255;\red252\green95\blue163;\red208\green191\blue105;\red108\green121\blue134;\red103\green183\blue164; } {\*\expandedcolortbl;;\csgenericrgb\c98912\c41558\c36568;\csgenericrgb\c12054\c12284\c14131;\cspthree\c93335\c100000\c89365; \csgenericrgb\c100000\c100000\c100000\c85000;\csgenericrgb\c98839\c37355\c63833;\csgenericrgb\c81498\c74939\c41233;\csgenericrgb\c42394\c47462\c52518;\csgenericrgb\c40538\c71705\c64209; } \margl1440\margr1440\vieww9000\viewh8400\viewkind0 \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0 \f0\fs24 \cf0 Lab 2 Pseudo-code\ \ declares use of cout cin and endl\ \ after main run getdata then printdata\ \ const int Cmax = 49.5 Cmin = -62 Fmax = 121 Fmin = -80\ \ int main\ \{\ variables temp, choice, windspeed, and windchill = 0\ \ run getdata then print data\ \ return nothing to main;\ \}\ int getdata\ \{\ \f1 \cf2 \cb3 \cf4 print\cf2 "Hello!"\cf5 \ \pard\tx593\pardeftab593\pardirnatural\partightenfactor0 \cf5 \cb3 print \cf2 "Will you be using Celsius or Fahrenheit? Please enter a '1' for Celsius and '2' for Fahrenheit"\cf5 \ user input = choice;\ \f2\b \cf6 \cb3 if \f1\b0 \cf5 \cb3 (choice == \cf7 \cb3 1\cf5 \cb3 ) \cf8 \cb3 //finding if the user wants C or F\cf5 \cb3 \ \{\ print \cf2 "What is the temperature? Please enter a value between "\cf5 <<\cf9 \cb3 CMIN\cf5 \cb3 <<\cf2 " and "\cf5 <<\cf9 \cb3 CMAX\cf5 \cb3 <<\ user input = temperature; \cf8 \cb3 //getting temp off of C\cf5 \cb3 \ \f2\b \cf6 \cb3 if \f1\b0 \cf5 \cb3 (temperature < \cf9 \cb3 CMIN\cf5 \cb3 )\ \{\ print \cf2 "Please enter a larger number"\cf5 \ user input = temperature;\ \}\ \f2\b \cf6 \cb3 else \f1\b0 \cf5 \cb3 \f2\b \cf6 \cb3 if \f1\b0 \cf5 \cb3 (temperature >\cf9 \cb3 CMAX\cf5 \cb3 )\ \{\ print \cf2 "Please enter a smaller number"\cf5 \ user input = temperature;\ \}\ \f2\b \cf6 \cb3 else \f1\b0 \cf5 \cb3 \ \{\ temperature = ((\cf7 \cb3 9\cf5 \cb3 /\cf7 \cb3 5\cf5 \cb3 ) * temperature + \cf7 \cb3 32\cf5 \cb3 );\ \}\ \}\ \f2\b \cf6 \cb3 else \f1\b0 \cf5 \cb3 \f2\b \cf6 \cb3 if \f1\b0 \cf5 \cb3 (choice == \cf7 \cb3 2\cf5 \cb3 )\ \{\ print \cf2 "What is the temperature? Please enter a value between "\cf5 <<\cf9 \cb3 FMIN\cf5 \cb3 <<\cf2 " and "\cf5 <<\cf9 \cb3 FMAX\cf5 \cb3 <<\ user input = temperature; \cf8 \cb3 //getting temp off of F\cf5 \cb3 \ \f2\b \cf6 \cb3 if \f1\b0 \cf5 \cb3 (temperature < \cf9 \cb3 FMIN\cf5 \cb3 )\ \{\ print \cf2 "Please enter a larger number"\cf5 \ user input = temperature;\ \}\ \f2\b \cf6 \cb3 else \f1\b0 \cf5 \cb3 \f2\b \cf6 \cb3 if \f1\b0 \cf5 \cb3 (temperature > \cf9 \cb3 FMAX\cf5 \cb3 )\ \{\ print \cf2 "Please enter a smaller number"\cf5 \ user input = temperature;\ \}\ \f2\b \cf6 \cb3 else \f1\b0 \cf5 \cb3 \ \{\ print \cf2 "Perfect!"\cf5 \ \}\ \}\ \f2\b \cf6 \cb3 else \f1\b0 \cf5 \cb3 \f2\b \cf6 \cb3 if \f1\b0 \cf5 \cb3 (choice > \cf7 \cb3 2\cf5 \cb3 or choice < \cf7 \cb3 1\cf5 \cb3 )\ \{\ \f2\b \cf6 \cb3 do \f1\b0 \cf5 \cb3 \ \{\ print \cf2 "Please enter 1 or 2"\cf5 \ user input = choice;\ \}\ \f2\b \cf6 \cb3 while \f1\b0 \cf5 \cb3 (choice > \cf7 \cb3 2\cf5 \cb3 || choice < \cf7 \cb3 1\cf5 \cb3 );\ \f2\b \cf6 \cb3 if \f1\b0 \cf5 \cb3 (choice == \cf7 \cb3 1\cf5 \cb3 ) \cf8 \cb3 //finding if the user wants C or F\cf5 \cb3 \ \{\ print \cf2 "What is the temperature? Please enter a value between "\cf5 <<\cf9 \cb3 CMIN\cf5 \cb3 <<\cf2 " and "\cf5 <<\cf9 \cb3 CMAX\cf5 \cb3 <<\ user input = temperature; \cf8 \cb3 //getting temp off of C\cf5 \cb3 \ \f2\b \cf6 \cb3 if \f1\b0 \cf5 \cb3 (temperature < \cf9 \cb3 CMIN\cf5 \cb3 )\ \{\ print \cf2 "Please enter a larger number"\cf5 \ user input = temperature\ \}\ \f2\b \cf6 \cb3 else \f1\b0 \cf5 \cb3 \f2\b \cf6 \cb3 if \f1\b0 \cf5 \cb3 (temperature > \cf9 \cb3 CMAX\cf5 \cb3 )\ \{\ print \cf2 "Please enter a smaller number"\cf5 \ user input = temperature;\ \}\ \f2\b \cf6 \cb3 else \f1\b0 \cf5 \cb3 \ \{\ temperature = ((\cf7 \cb3 9\cf5 \cb3 /\cf7 \cb3 5\cf5 \cb3 ) * temperature + \cf7 \cb3 32\cf5 \cb3 );\ \}\ \}\ \f2\b \cf6 \cb3 else \f1\b0 \cf5 \cb3 \f2\b \cf6 \cb3 if \f1\b0 \cf5 \cb3 (choice == \cf7 \cb3 2\cf5 \cb3 )\ \{\ print \cf2 "What is the temperature? Please enter a value between "\cf5 <<\cf9 \cb3 FMIN\cf5 \cb3 <<\cf2 " and "\cf5 <<\cf9 \cb3 FMAX\cf5 \cb3 <<\ user input = temperature; \cf8 \cb3 //getting temp off of F\cf5 \cb3 \ \f2\b \cf6 \cb3 if \f1\b0 \cf5 \cb3 (temperature < \cf9 \cb3 FMIN\cf5 \cb3 )\ \{\ print \cf2 "Please enter a larger number"\cf5 \ user input = temperature;\ \}\ \f2\b \cf6 \cb3 else \f1\b0 \cf5 \cb3 \f2\b \cf6 \cb3 if \f1\b0 \cf5 \cb3 (temperature > \cf9 \cb3 FMAX\cf5 \cb3 )\ \{\ print \cf2 "Please enter a smaller number"\cf5 \ user input = temperature;\ \}\ \f2\b \cf6 \cb3 else \f1\b0 \cf5 \cb3 \ \{\ print \cf2 "Perfect!"\cf5 \ \}\ \}\ \}\ \f2\b \cf6 \cb3 else \f1\b0 \cf5 \cb3 \ \{\ print \cf2 "uhhhh something went wrong"\cf5 \ \}\ print \cf2 "Now what is the windspeed in MPH? Please enter a value less than 231 and greater than 0"\cf8 \cb3 //finding windspeed\cf5 \cb3 \ user input = windspeed;\ \f2\b \cf6 \cb3 if \f1\b0 \cf5 \cb3 (windspeed > \cf7 \cb3 231\cf5 \cb3 )\ \{\ print \cf2 "Please enter a smaller value"\cf5 \ user input = windspeed;\ \}\ \f2\b \cf6 \cb3 else \f1\b0 \cf5 \cb3 \f2\b \cf6 \cb3 if \f1\b0 \cf5 \cb3 (windspeed < \cf7 \cb3 0\cf5 \cb3 )\ \{\ print \cf2 "please enter a larger number"\cf5 \ user input = windspeed;\ \}\ \f2\b \cf6 \cb3 else \f1\b0 \cf5 \cb3 \ \{\ windchill = (\cf7 \cb3 35.74\cf5 \cb3 + \cf7 \cb3 0.6215\cf5 \cb3 * (temperature) - \cf7 \cb3 35.75\cf5 \cb3 * ((windspeed)^\cf7 \cb3 16\cf5 \cb3 ) + \cf7 \cb3 0.4275\cf5 \cb3 * (temperature) * ((windspeed)^\cf7 \cb3 16\cf5 \cb3 )); \cf8 \cb3 //getting windchill\cf5 \cb3 \ \} \f0 \cf0 \cb1 \ \pard\tx720\tx1440\tx2160\tx2880\tx3600\tx4320\tx5040\tx5760\tx6480\tx7200\tx7920\tx8640\pardirnatural\partightenfactor0 \cf0 \ return choice, temperature, windspeed, and windchill to main\ \}\ void printdata\ \{\ if choice == 1\ \{\ print \f1 \cf2 \cb3 "You chose to input your temperature in Celsius. The program has convertered the temp into Fahrenheit and the temperature is "\cf5 <