summaryrefslogtreecommitdiff
path: root/BlankConsoleLab/BlankConsoleLab.cpp
blob: 4ceba9e46f784e812e8bf524af4668bec0a98119 (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
68
69
70
71
72
73
74
75
76
77
// 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 length;
    float width;
    float area_cm;
    float area_m;
    float ratio;
    int grav = 9.81;
    int weight = 135;
    float grav_pull;
    float masskg;


    do
    {
        cout << "Enter length of kite in cm: ";
        cin >> length;

        cout << "Enter width of kite in cm: ";
        cin >> width;


        cout << "Length = " << length << " cm" << endl;

        cout << "Width = " << width << " cm" << endl;

        cout << " " << endl;

    } while ((length < 1 || length > 400) || (width < 1 || width > 400));
   

    // area calculation
    area_cm = (length * width) / 2;

    // unit conversion
    area_m = area_cm / 10000;

    cout << "Kite area = " << area_m << " square meters" << endl;

    // aspect ratio
    ratio = width / length;


    if (ratio > 1)
        cout << "WARNING! A lower aspect ratio would provide more stability" << endl;




    // mass calculation
    masskg = (area_m * weight) / 1000;

        cout << "Total mass of the kite is: " << masskg << " Kg" << endl;

    //force applied to the kite converted to Newtons

    grav_pull = masskg * grav;

        cout << "Gravitational pull applied to the kite is: " << grav_pull << " Newtons" << endl;

    return 0;
}