summaryrefslogtreecommitdiff
path: root/BlankConsoleLab/BlankConsoleLab.cpp
blob: 9f65cad18527b0cd747f4bacfa93c7d9ea2d6b78 (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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
// BlankConsoleLab.cpp : This file contains the 'main' function. Program execution begins and ends there.
//

/*Name: Anibal Lopez-Bonilla
*Project Lab01 Kite
* Last Editied 10/19/22 
* 
*/

#include <iostream>

using namespace std;

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

    //Variables used in the programming.
    float width;
    float length;
    float Area;
    float aspectR;
    float Mass;

    float graPull;

int main()
{


    //Welcome Message
    cout << "Hello welcome to the Kite App" << endl << endl;
    
    //Enter Width and Length in centimeters
        cout << "Please enter your kite's width in CM "<< endl;
        cin >> width;
        while (width < 1 || width > 400)
        {
            cout << "Please enter your kite's width in CM " << endl;
            cin >> width;
        }


        cout << "Please Enter your kite's length in CM " << endl;
        cin >> length;
        while (length < 1 || length > 400)
        {
        cout << "Please Enter your kite's length in CM " << endl;
        cin >> length;
        } 

    //Output the measures entered by user
    cout << "Your kite Measurements is ";
    cout << width;
    cout << " By "; 
    cout <<length << endl;

    //Area is calculated and converted to square meters.
    
    //Area calculation
    Area = (width * length) / 2;

    //Conversion calculation to square meters.
    Area = Area / 10000;

    //Output of the area calculation to square meters.
    cout << "The area of the kite in squre meter is ";
    cout << Area;
    cout << " Square Meters" <<endl;
    //Aspect Ratio calculation
    aspectR = width / length;

    //Aspect Ratio Message
    cout << "The aspect ratio of your kite is ";
    cout << aspectR << endl;

    // if the aspect ratio is greater than equal to 1 display the
    // following message.
    if (aspectR >= 1)
    {
        //message used if the aspect ratio is greater than equal to one
        cout << "Keep in mind, a lower aspect ratio would provide more stability";
    }

    //Mass calculation
    Mass = Area * 135 / 1000;
    //Gravity Pull Calculation
    graPull = Mass * 9.8;

    //Display the result of the mass calculation
    cout << "Your Kite Weighs: " << Mass << endl ;
   
    //Display the result of the gravitational pull calculation
    cout << "The gravitational pull of your kite is " << graPull << endl;
}