blob: 98ddf035a5db7be84ded6de51be1def1f9f3b63d (
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
|
//William Bishop
//[email protected] Here we have the contact information and my name.
// BlankConsoleLab.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream> Here we are including the iostream.
using namespace std; Here we are using the standard start of the c++ function.
constant int x = mass / sq_meter; This is the constant to print out mass in sqare meter realm
using std::cout; Here we have the cout function happening.
using std::cin; Here we have the cin function directives.
using std::endl; Here we have the end line directives
int main() Here is the start of the main function
{
string sq_meter; Here we have the square meter definition string
constant int x = mass / sq_meter;
int kite; Here we have a kite integer
int horizontal_kitew; Here we have the horizontal width of the kite
int vertical_kitel; Here we have the length of the kite
cout << "Please enter a width of the kite" << endl; Here we ask for the width of the kite
cin >> horizontal_kitew Here we get the input of the kite
cout << "Your width is: " << horizontal_kitew << endl; Here we get the width of the kite output
cout << "Please enter your height of the kite " << endl; This is the asking for the length of the kite
cin >> vertical_kitel; Here we get the input of the kite
cout << "Our width and the height is: " << horizontal_kitew << "and " << vertical_kitel << endl; Here we have the width and length of the kite output.
int areaofkite;
int areaofkite = (horizontal_kitew * vertical_kitel) / 2; Here we have the area of the kite.
cout << "The area of the kite is " << areaofkite;
float Area_of_kiteM;
float Area_of_kiteM = areaofkite / 10000; Here we get the area of the kite in meters.
cout << " " << Area_of_kiteM << endl;
float aspectratio;
float aspectratio = horizontal_kitew / vertical_kitel; Here we have the aspectratio of the kite.
cout << " Our aspect ratio is : " << aspectratio << endl;
if (aspectratio >= 1)
cout << " WARNING : A lower aspect ratio than 1 would make more stability. " << endl; Here we output if the aspect ratio is less than one or not.
//Part two
int width2;
int length2;
float area2; Here we have the width and length for the part two of the kite.
cout << "Please enter the width of the kite from cm: ";
cout << " Please enter a width of the kite from 1 to 400. " << endl; Here we get the width of the kite asking inside of the function.
cin >> width2;
if (width2 > 0 && width2 < 401)
cout << "Thank you for entering. " << width2; If the width isn't from 1 to 400 we ask for the width again.
else
cout << "Please enter the width from 1 to 400. " << endl;
cin >> width2;
cout << "Please enter the length of the kite from cm: "; Here we get the length of the kite asking.
cout << " Please enter a length of the kite from 1 to 400. " << endl;
cin >> length2;
if (length2 > 0 && length2 < 401)
cout << "Thank you for entering. " << length2; Here get the input of the kite's length and the known else statement if the kite isn't from 1 to 400 in length.
else
cout << "Please enter the length from 1 to 400. " << endl;
cin >> length2;
float area2 = length2 * width2;
cout << "The area is " << area2; Here we get the area of the kite from part two of the program
float weight;
float mass;
float height;
float density; Here we have the floats for what is the weight, mass, height, and the density of the kite.
cout << "Please intput the weight of the kite in kgs. "; Here get the weight of the kite
cin >> weight;
cout << "Please input the height of the kite meters " << endl; Here we get the height of the kite
cin >> height;
cout << "Please input the density of the kite in kilograms per cubic meter. " << endl; Here we get the density of the kite.
cin >> density;
cout << "Our density of the kite is " << density << "Our height of the kite is " << height<<endl;
float volume; Here we have the volume float
float length2meters;
float width2meters;
float length2meters = length2 / 10000;
float width2meters = width2 / 10000; Here we have our width and length of the kite in meters
float area2 = width2meters * length2meters; Here we have the area of the kite
float volume = area2 * height; Here we have the volume of the kite
float mass = volume * density; Here we have the mass of the kite
cout << "Our total mass of our kite is " << mass<<endl; Here we have the total mass of the kite
string sq_meter = "sqmeter";
cout << " Our mass is " << x << endl; Here we output out mass from the constant of what is the string square meter and the mass float.
float Gravity_Pull;
float distance;
cout << "Please enter the distance from earth of the kite in meters. "
cin >> distance;
Gravity_Pull = (10 * mass^2) / distance;
cout << "The pull on gravity from our kite is " << Gravity_Pull << "m^2/kg^2" << endl; Here we get the gravitational pull of the kite.
}
|