summaryrefslogtreecommitdiff
path: root/BlankConsoleLab/BlankConsoleLab.cpp
diff options
context:
space:
mode:
authorTrevor Bouchillon <[email protected]>2022-10-16 17:23:32 -0700
committerTrevor Bouchillon <[email protected]>2022-10-16 17:23:32 -0700
commit3f1526d957fb62390258fc9a9a9898cd113a3b85 (patch)
treeefa68151ea05eb06ddcba3d8bb6709f4fba60847 /BlankConsoleLab/BlankConsoleLab.cpp
parentgravitational pull added (diff)
downloadcst116-lab1-daboochillin-3f1526d957fb62390258fc9a9a9898cd113a3b85.tar.xz
cst116-lab1-daboochillin-3f1526d957fb62390258fc9a9a9898cd113a3b85.zip
comments added
Diffstat (limited to 'BlankConsoleLab/BlankConsoleLab.cpp')
-rw-r--r--BlankConsoleLab/BlankConsoleLab.cpp30
1 files changed, 15 insertions, 15 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp
index 6b95972..e572cd1 100644
--- a/BlankConsoleLab/BlankConsoleLab.cpp
+++ b/BlankConsoleLab/BlankConsoleLab.cpp
@@ -22,8 +22,8 @@ int main()
float kitemass = 0;
float gravitationalpull = 0;
- while (kitewidth < 1 || kitewidth >400) {
- cout << "Please enter width of kite (horizontal diagonal) in meters." << endl;
+ while (kitewidth < 1 || kitewidth >400) { //while loop to ensure kite size is within limitations
+ cout << "Please enter width of kite (horizontal diagonal) in meters." << endl;
cin >> kitewidth;
if (kitewidth < 1) {
cout << "Please enter a value between 1 and 400" << endl;
@@ -32,7 +32,7 @@ int main()
cout << "Please enter a value between 1 and 400" << endl;
}
}
- while (kitelength < 1 || kitelength > 400) {
+ while (kitelength < 1 || kitelength > 400) { //while loop to ensure kite size is within limitations
cout << "Please enter length of kite (vertical diagonal) in meters." << endl;
cin >> kitelength;
if (kitelength < 1) {
@@ -43,25 +43,25 @@ int main()
}
}
- cout << "Your kites length is: " << kitelength << " meters, and your kites width is: " << kitewidth << " meters." << endl;
+ cout << "Your kites length is: " << kitelength << " meters, and your kites width is: " << kitewidth << " meters." << endl; //kite size outputs.
- kiteaream = (kitewidth * kitelength) / 2;
- kiteareacm = kiteaream / 10000;
- cout << "Your kites area in meters is: " << kiteaream << " meters squared." << endl;
+ kiteaream = (kitewidth * kitelength) / 2; //calculating kites area in meters
+ kiteareacm = kiteaream / 10000; //calculating kites area in centimeters
+ cout << "Your kites area in meters is: " << kiteaream << " meters squared." << endl; //kite area output
- kitemass = kiteaream * .135;
- cout << "Your kites mass is: " << kitemass << " kilograms." << endl;
+ kitemass = kiteaream * .135; //kite mass calculation
+ cout << "Your kites mass is: " << kitemass << " kilograms." << endl; //kite mass output
- gravitationalpull = kitemass * 9.8;
- cout << "The gravitational pull on your kite is: " << gravitationalpull << " Newtons. " << endl;
+ gravitationalpull = kitemass * 9.8; //kite gravitational pull calulation
+ cout << "The gravitational pull on your kite is: " << gravitationalpull << " Newtons. " << endl; //kite gravitational pull output
- kiteaspectratio = kitewidth / kitelength;
+ kiteaspectratio = kitewidth / kitelength; //kite aspect ratio calculation
- if (kiteaspectratio >= 1) {
- cout << "WARNING: Your kites aspect ratio is larger then or equal to 1. A smaller aspect ratio will provide your kite more stability." << endl;
+ if (kiteaspectratio >= 1) { //kite aspect ratio comparison for stability warning
+ cout << "WARNING: Your kites aspect ratio is larger then or equal to 1. A smaller aspect ratio will provide your kite more stability." << endl; //stability warning output
}
- cout << "Your kites apsect ratio is: " << kiteaspectratio;
+ cout << "Your kites apsect ratio is: " << kiteaspectratio; //kite aspect ratio output
}