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
{
   print "Hello!"
   print "Will you be using Celsius or Fahrenheit? Please enter a '1' for Celsius and '2' for Fahrenheit"
   user input = choice;
    if (choice == 1) //finding if the user wants C or F
    {
       print "What is the temperature? Please enter a value between "<<CMIN<<" and "<<CMAX<<
       user input = temperature; //getting temp off of C
        if (temperature < CMIN)
        {
           print "Please enter a larger number"
           user input = temperature;
        }
        else if (temperature >CMAX)
        {
           print "Please enter a smaller number"
           user input = temperature;
        }
        else
        {
            temperature = ((9/5) * temperature + 32);
        }
    }
    else if (choice == 2)
    {
       print "What is the temperature? Please enter a value between "<<FMIN<<" and "<<FMAX<<
       user input = temperature; //getting temp off of F
        if (temperature < FMIN)
        {
           print "Please enter a larger number"
           user input = temperature;
        }
        else if (temperature > FMAX)
        {
           print "Please enter a smaller number"
           user input = temperature;
        }
        else
        {
           print "Perfect!"
        }
    }
    else if (choice > 2 or choice < 1)
    {
        do
        {
           print "Please enter 1 or 2"
                user input = choice;
        }
        while (choice > 2 || choice < 1);
        if (choice == 1) //finding if the user wants C or F
        {
           print "What is the temperature? Please enter a value between "<<CMIN<<" and "<<CMAX<<
           user input =  temperature; //getting temp off of C
            if (temperature < CMIN)
            {
               print "Please enter a larger number"
               user input = temperature
            }
            else if (temperature > CMAX)
            {
              print "Please enter a smaller number"
              user input = temperature;
            }
            else
            {
                temperature = ((9/5) * temperature + 32);
            }
        }
        else if (choice == 2)
        {
           print "What is the temperature? Please enter a value between "<<FMIN<<" and "<<FMAX<<
            user input = temperature; //getting temp off of F
            if (temperature < FMIN)
            {
              print "Please enter a larger number"
              user input = temperature;
            }
            else if (temperature > FMAX)
            {
               print "Please enter a smaller number"
               user input = temperature;
            }
            else
            {
               print "Perfect!"
            }
        }
    }
    else
    {
       print "uhhhh something went wrong"
    }
   print "Now what is the windspeed in MPH? Please enter a value less than 231 and greater than 0"//finding windspeed
   user input = windspeed;
    if (windspeed > 231)
    {
       print "Please enter a smaller value"
       user input = windspeed;
    }
    else if (windspeed < 0)
    {
       print "please enter a larger number"
       user input = windspeed;
    }
    else
    {
        windchill = (35.74 + 0.6215 * (temperature) - 35.75 * ((windspeed)^16) + 0.4275 * (temperature) * ((windspeed)^16)); //getting windchill
    }

return choice, temperature, windspeed, and windchill to main
}
void printdata
{
if choice == 1
 {
   print "You chose to input your temperature in Celsius. The program has convertered the temp into Fahrenheit and the temperature is "<<temperature<<
}
else if choice == 2
{
print "You chose to input your temperature in Fahrenheit. You input "<<temperature<<
}
else 
{
print "Something went wrong..."
} 
print "You put "<<windspeed<<" for your windspeed"
print "Based off your temperature and windspeed, the windchill is "<<windchill<<
}