summaryrefslogtreecommitdiff
path: root/BlankConsoleLab/BlankConsoleLab.cpp
diff options
context:
space:
mode:
authorAnibal LopezBonilla <[email protected]>2022-10-05 16:44:48 -0700
committerAnibal LopezBonilla <[email protected]>2022-10-05 16:44:48 -0700
commit7444a92435fec786d48c02da4354c92a9cb5fe4a (patch)
tree65860266a7c055a774bf37a0eedcf2c6a78fa299 /BlankConsoleLab/BlankConsoleLab.cpp
parentPush 1 Part 1 (diff)
downloadcst116-lab1-lopez-bonilla-7444a92435fec786d48c02da4354c92a9cb5fe4a.tar.xz
cst116-lab1-lopez-bonilla-7444a92435fec786d48c02da4354c92a9cb5fe4a.zip
Push 2 Part 2
Diffstat (limited to 'BlankConsoleLab/BlankConsoleLab.cpp')
-rw-r--r--BlankConsoleLab/BlankConsoleLab.cpp33
1 files changed, 22 insertions, 11 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp
index e83e6f9..ce7017e 100644
--- a/BlankConsoleLab/BlankConsoleLab.cpp
+++ b/BlankConsoleLab/BlankConsoleLab.cpp
@@ -9,34 +9,45 @@ using std::cout;
using std::cin;
using std::endl;
-int main()
-{
//Variables used in the programming.
- float width;
+ float w;
float length;
float Area;
float aspectR;
+int main()
+{
+
//Welcome Message
cout << "Hello welcome to the Kite App" << endl << endl;
+ cout << "Please enter your kite's width in CM "<< endl;
+ cin >> w;
+ while (w < 1 || w > 400)
+ {
+ cout << "Please enter your kite's width in CM " << endl;
+ cin >> w;
+ }
+
//Enter Width and Length in centimeters
- cout << "Please enter your kite's width in CM "<< endl;
- cin >> width;
- cout << "Please Enter your kite's length in CM " <<endl;
- cin >> length;
-
+ 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 << w;
cout << " By ";
cout <<length << endl;
//Area is calculated and converted to square meters.
//Area calculation
- Area = (width * length) / 2;
+ Area = (w * length) / 2;
//Conversion calculation to square meters.
Area = Area / 10000;
@@ -46,7 +57,7 @@ int main()
cout << Area;
cout << " Square Meters" <<endl;
- aspectR = width / length;
+ aspectR = w / length;
cout << "The aspect ratio of your kite is ";
cout << aspectR << endl;