From ceba0637f91dfc5c7d5a4dda49c13c472af8c629 Mon Sep 17 00:00:00 2001 From: WilliamBishopCST116 <114703314+WilliamBishopCST116@users.noreply.github.com> Date: Mon, 7 Nov 2022 15:08:52 -0800 Subject: Add files via upload --- CST116-Lab2-Pseudocode-Bishop.txt | 102 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 102 insertions(+) create mode 100644 CST116-Lab2-Pseudocode-Bishop.txt diff --git a/CST116-Lab2-Pseudocode-Bishop.txt b/CST116-Lab2-Pseudocode-Bishop.txt new file mode 100644 index 0000000..a9fbf0d --- /dev/null +++ b/CST116-Lab2-Pseudocode-Bishop.txt @@ -0,0 +1,102 @@ +// BlankConsoleLab.cpp : This file contains the 'main' function. Program execution begins and ends there. +// +//William Bishop +//william.bishop@oit.edu +#include + +using namespace std; + +using std::cout; +using std::cin; +using std::endl; Here we have the headers to start the code. + +int CelciusintoFahrenheit1(float F); +int WindMPH(float wind); +void WinddChill(float chill, float wind); Here I have the three functions that I am using to create a different work to create the information of the main function +int main() +{ + const int maxC = 49.5; + const int maxF = 121; + const int minC = -62; + const int minF = -80; Here we have the constants of the max and min of the Celcius and Fahrenheit temperatures. + + + float windspeed; + float temperature; Here we have some starting variables. + cout << "Please enter the temperature in Fahrenheit or Celcius. Please also enter the wind speed in mph." << endl; + cout << "Please enter the fahrenheit temperature from -80 to 121." << endl; + cout << " Please enter the temperature from celcius should be from -62 to 49.5 and the speed should be 0 to 231 mph." << endl; Here we ask for some windspeed and temperature values + float CelciustoFahrenheit; + cin >> temperature; + cin >> windspeed; Here we get some more values + + CelciustoFahrenheit = (9 / 5) * temperature + 32; Here we calculate celcius to fahrenheit. + + if (CelciustoFahrenheit >= minC && CelciustoFahrenheit <= maxC) + cout << "Thank you for entering a great temperature."; + else + cout << "Please enter another temperature." << endl; Here we get the input for the temperature and if it isn't a right value then we get another value from the user + cin >> temperature; + + float windchillFromCelc; + float windchillFromFahr; Here we have the wind chill variables. + + windchillFromCelc = windspeed * .7 - CelciustoFahrenheit; + windchillFromFahr = windspeed * .7 - temperature; Here we are calculating wind chill. + + float WindChill; + WindChill = windchillFromFahr; + cout << "The wind chill from the temperature if you entered entered the temperature in Celcius is: " << windchillFromCelc << endl; + cout << "The wind chill from the temperature if you entered the temperature in Fahrenheit is : " << windchillFromFahr << endl; Here we are outputting the windchill variables. + + cout << temperature << " " << CelciustoFahrenheit << " " << windspeed << " " << windchillFromFahr << " " << windchillFromCelc << endl; Here we are outputting our temperature, windspeed and windchill + cout << " We see Temperature, then the temperature if it were celcius into fahrenheit and then the windspeed. "; + cout << "We also see the windchill from temperature if it were in fahrenheit and if it were in celcius." << endl; We are talking about the output. + + + int CelciusintoFahrenheit1(float F); + int WindMph(windspeed); + int x = 5; + int y = 7; + WinddChill(windchillFromCelc, windspeed); Here we have our three functions in the program + +} + +int CelciusintoFahrenheit1(float F) +{ + int temperaturec; + cout << "please enter a temperature."; Here is a function to return the value of a temperture from celcius into Fahrenheit. + cin >> temperaturec; + + F = (9 / 5) * temperaturec + 32; //Here is the function where I am returning a value meaning F as the Fahrenheit Temp. + return F; +} +int WindMPH(float wind) +{ + int MPH; + MPH = wind; + + cout << "Please enter a wind speed."; //Here I am passing by reference with the wind and windspeed into main. + cin >> MPH; + cout << wind; Here are passing by reference the wind from MPH into the windspeed inside of main. + + + +} + +void WinddChill(float chill, float wind) +{ + + float c; + c = chill; + float d; + d = wind; + cout << "Thank you please enter a float for the chill and wind."; //Here I am passing by value into the function. + cin >> chill; + cin >> wind; + cout << chill; Here we are passing by value a couple more values into the program so someone could use them later. + cout << wind; + + +} + -- cgit v1.2.3