summaryrefslogtreecommitdiff
path: root/BlankConsoleLab/BlankConsoleLab.cpp
blob: 64390e6c20753a76fca9ed5bc3794f500a15c137 (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
53
54
55
56
57
58
59
60
61
62
63
64
65
// 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()
{
    int i = 0;
    float width, length;

    while (i == 0)

    {
        cout << "Enter the width of the kite in meters. Please enter a value between 1 and 400." << endl;
        cin >> width;

        cout << "Enter the length of the kite in meters. Please enter a value between 1 and 400." << endl;
        cin >> length;

        if ((1 <= width && width <= 400) && (1 <= length && length <= 400))
        {
            cout << "You have entered  " << width << "  meters for width." << endl;
            cout << "You have entered  " << length << "  meters for length." << endl;
            i = 1;
        }
        else
        {
            cout << "Please only enter values between 1 and 400." << endl;
        }

    }

    float ratio = (width / length);

    if (ratio >= 1)
    {
        cout << "WARNING: A lower aspect ratio will provide more stability." << endl;
    }

    float areacm = (width * length/2);
    float areamt = (areacm / 10000);

        cout << "Area of kite is   " << areamt <<"  square meters" << endl;

    float mass = (areamt*135/1000);

    cout << "Weight of kite is  " << mass << "kg" << endl;

    float grav = (mass * 9.8);

    cout << "Gravitational pull is  " << grav << "  newtons per kg" << endl;

   
    return 0;


}