blob: c0d3a6b8e73ba2be11ef2689b15c0798922b786b (
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
|
//
// main.cpp
// CST116-Lab1 Kite Demtion Project LeviDavis
//
// Created by Levi on 10/13/22.
//
#include <iostream>
int width = 0;
int length = 0;
float area = 0;
float aspectratio = 0;
float mass = 0;
float gravitationalpull = 0;
using namespace std;
using std::cout;
using std::cin;
using std::endl;
int main()
{
do {
cout << "What is your kite's width in cenemeters? Please enter a width between 1-400 cm" << endl;
cin >> width;
if (width > 400 || width < 1)
cout << "Please enter a different width" <<endl;
} while (width > 400 || width < 1);
do {
cout << "Now what is the length of your kite in cenemeters? Please enter a length between 1-400 cm" <<endl;
cin >> length;
if (length > 400 || length > 1)
cout << "Please enter a different length"<<endl;
} while (length > 400 || length < 1);
cout << "The width of your kite is " <<width<<" and the length is " <<length<<endl;
area = (length * width) / 2;
area = area / 1000;
cout << "The area of your kite in sq meters is " <<area<<endl;
aspectratio = width / length;
cout << "Your aspect ratio is " <<aspectratio<<endl;
if(aspectratio >= 1)
cout << "Your kite is not very stable, a lower aspect ratio would make it more stable"<<endl;
else if(aspectratio < 1)
cout << "Your kite is stable! Congrats"<<endl;
mass = ((length * width) * 135) / 1000;
cout << "In kg your kite weighs " <<mass<<endl;
gravitationalpull = mass * 9.8;
cout <<"The gravitational pull of your kite is "<<gravitationalpull<<"N/kg"<<endl;
return 0;
}
|