blob: a7e3091e7ea263afcead9c20d8e95a2fce619907 (
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
|
//William Bishop
//[email protected] Here we have the name and my contact information
// BlankConsoleLab.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include <iostream> Here we are including the iostream in the program.
using namespace std; Here we are using the namespace std working
using std::cout;
using std::cin;
using std::endl;
using std::basic_string; Here I am including std works of basic string and cout with cin.
int main() This is the start of the main function.
{
float mass; Here we have
int kite;
string sq_meter;
int horizontal_kitew;
int vertical_kitel; Here we have the integers that are the width and length of the kite with the some more strings.
cout << "Please enter a width of the kite in cm" << endl;
cin >> horizontal_kitew;
cout << "Your width is: " << horizontal_kitew << endl; Here we get the width of the kite.
cout << "Please enter your length of the kite " << endl;
cin >> vertical_kitel;
cout << "Our width and the length is: " << horizontal_kitew << "and " << vertical_kitel << endl; Here we have length and width of our kite.
int areaofkite;
areaofkite = (horizontal_kitew * vertical_kitel) ;
cout << "The area of the kite is " << areaofkite; Here we have the area of the kite
float Area_of_kiteM;
Area_of_kiteM = areaofkite / 10000; Here we have the area of the kite in meters instead of centimeters.
cout << " " << Area_of_kiteM << endl;
float aspectratio;
aspectratio = horizontal_kitew / vertical_kitel;
cout << " Our aspect ratio is : " << aspectratio << endl; Here we get the aspectratio of the kite
if (aspectratio >= 1)
cout << " WARNING : A lower aspect ratio than 1 would make more stability. " << endl; Here is the work if the aspectratio of the work is from greater than or equal to one
//Part two
float width2;
float length2;
float area2; Here we have the declarations of the floats from the part two of the program
cout << "Please enter the width of the kite: "; Here we have the asking for the width of the program
cout << " Please enter a width of the kite from 1 to 400. " << endl;
cin >> width2;
if (width2 > 0 && width2 < 401)
cout << "Thank you for entering. " << width2; Here we have the entering of the width between 1 to 400 in centimeters
else
cout << "Please enter the width from 1 to 400. " << endl; If the the width isn't from 1 to 400 we ask again
cin >> width2;
cout << "Please enter the length of the kite: "; Here we ask to get the length of the kite
cout << " Please enter a length of the kite from 1 to 400. " << endl; If the length isn't from 1 to 400 we ask again.
cin >> length2;
if (length2 > 0 && length2 < 401)
cout << "Thank you for entering. " << length2; Here we have it if the length is inside the number range we asked for.
else
cout << "Please enter the length from 1 to 400. " << endl; Here we have the length we asking for if isn't the number we want.
cin >> length2;
area2 = length2 * width2; Here we have the area of the kite.
cout << "The area is " << area2; Here we have the work that is the area of the kite inside their time
float weight;
float height;
float density; Here we have the floats that are in the in the end of the program
cout << "Please intput the weight of the kite. ";
cin >> weight; Here have the input of the weight of the kite.
cout << "Please input the height of the kite " << endl;
cin >> height; Here we have the height of the kite.
cout << "Please input the density of the kite in kilograms per cubic meter. " << endl;
cin >> density; Here we have the density of the kite.
cout << "Our density of the kite is " << density << "Our height of the kite is " << height << endl; Here we have the density and height of the kite.
float volume;
float length2meters;
float width2meters; Here we have the length and width for what is inside meters instead of centimeters.
length2meters = length2 / 10000;
width2meters = width2 / 10000; Right here we have the length and width from meters.
area2 = width2meters * length2meters; Here we have the area in square meters.
volume = area2 * height; Here we have the volume of the kite in cubic meters.
mass = volume * density; Here we have the mass of the kite.
cout << "Our mass of our kite is " << mass << endl; Here we have the mass of the kite in kg
const int Masspersqmeter = mass;
cout << " Our mass is " <<mass << endl;
float Gravity_Pull;
float distance;
cout << "Please enter the distance from earth of the kite in meters. "; Here we have the distance and the gravity pull floats with the output of mass.
cin >> distance;
float Gravity_Pullhelp = mass * mass;
Gravity_Pull = (10 * Gravity_Pullhelp) / distance;
cout << "The pull on gravity from our kite is " << Gravity_Pull << "m^2/kg^2" << endl; Here we calculate the gravity pull on the kite.
|