summaryrefslogtreecommitdiff
path: root/BlankConsoleLab/BlankConsoleLab.cpp
blob: 6b95972e1d73408d6018920593c308e69c3f07fd (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
66
67
// 
// Lab1 
// Trevor Bouchillon
// CST116
//

#include <iostream>

using namespace std;

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

int main()
{
    float kitewidth = 0;
    float kitelength = 0;
    float kiteaream = 0;
    float kiteareacm = 0;
    float kiteaspectratio = 0;
    float kitemass = 0;
    float gravitationalpull = 0;

    while (kitewidth < 1 || kitewidth >400) {
        cout << "Please enter width of kite (horizontal diagonal) in meters." << endl;
        cin >> kitewidth;
        if (kitewidth < 1) {
            cout << "Please enter a value between 1 and 400" << endl;
        }
        else if (kitewidth > 400){
            cout << "Please enter a value between 1 and 400" << endl;
        }
    }
    while (kitelength < 1 || kitelength > 400) {
        cout << "Please enter length of kite (vertical diagonal) in meters." << endl;
        cin >> kitelength;
        if (kitelength < 1) {
            cout << "Please enter a value between 1 and 400" << endl;
        }
        else if (kitelength > 400) {
            cout << "Please enter a value between 1 and 400" << endl;
        }
    }

    cout << "Your kites length is: " << kitelength << " meters, and your kites width is: " << kitewidth << " meters." << endl;

    kiteaream = (kitewidth * kitelength) / 2;
    kiteareacm = kiteaream / 10000;
    cout << "Your kites area in meters is: " << kiteaream << " meters squared." << endl;

    kitemass = kiteaream * .135;
    cout << "Your kites mass is: " << kitemass << " kilograms." << endl;

    gravitationalpull = kitemass * 9.8;
    cout << "The gravitational pull on your kite is: " << gravitationalpull << " Newtons. " << endl;

    kiteaspectratio = kitewidth / kitelength;

    if (kiteaspectratio >= 1) {
        cout << "WARNING: Your kites aspect ratio is larger then or equal to 1. A smaller aspect ratio will provide your kite more stability." << endl;
    }

    cout << "Your kites apsect ratio is: " << kiteaspectratio;
    
}