summaryrefslogtreecommitdiff
path: root/BlankConsoleLab/BlankConsoleLab.cpp
blob: 1a0091da56a54adebbdf7956005568b1e926322c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
// BlankConsoleLab.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

#include <iostream>

using namespace std;

using std::cout;
using std::cin;
using std::endl;

float UserInputTemp;
float WindSpeed;


float CelciusToFarenheit(float Celcius2Farenheit) {
    Celcius2Farenheit = (UserInputTemp * (9 / 5)) + 32;
    return Celcius2Farenheit;
}

int main()
{

    cout << "Please enter a temperature in Celcius: ";
    cin >> UserInputTemp;

    while (UserInputTemp < -62 || UserInputTemp > 49.5) {
        cout << "Please enter a temperature between -62 and 49.5." << endl;
        cout << "Please enter a temperature in Celcius: ";
        cin >> UserInputTemp;
    }

    cout << "Please enter a wind speed in Miles Per Hour: ";
    cin >> WindSpeed;
    while (WindSpeed < 0 || WindSpeed > 231) {
        cout << "Please enter a wind speed between 0 and 231 Miles Per Hour" << endl;
        cout << "Please enter a wind speed in Miles Per Hour: ";
        cin >> WindSpeed;
    }

    
    cout << "The temperature you entered is " << CelciusToFarenheit(UserInputTemp) << " degrees in Farenheit." << endl;
    
    return 0;
}