summaryrefslogtreecommitdiff
path: root/BlankConsoleLab/BlankConsoleLab.cpp
blob: 3e4a160d0b683e95eaa1c288ea26ef74fed50f07 (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
47
48
49
50
51
52
// 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;

int main()
{
    float width, length, area, ratio;
   
    cout << "Enter width (cm) : ";
    cin >> width;   
    while (width < 1 || width > 400)
    {
        cout << "value must be between 1 and 400" << endl;
        cout << "Enter width (cm) : ";
        cin >> width;
    }
    cout << "Enter length (cm) : ";
    cin >> length;
    while (length < 1 || length > 400)
    {
        cout << "value must be between 1 and 400" << endl;
        cout << "Enter length (cm) : ";
        cin >> length;
    }



    cout << "width: ";
    cout << width<< endl;
    cout << "length: ";
    cout << length << endl;
    
    area = (width * length / 2) / 10000;
    cout << "area (m) : ";
    cout << area << endl;

    ratio = width / length; 
    cout << "ratio: ";
    cout << ratio << endl;
    if (ratio >= 1)
        cout << "a lower aspect ratio would provide more stability";


}