summaryrefslogtreecommitdiff
path: root/BlankConsoleLab
diff options
context:
space:
mode:
authoralexandra-apetroaei <andra@MSI>2022-10-17 22:20:22 -0800
committeralexandra-apetroaei <andra@MSI>2022-10-17 22:20:22 -0800
commit1de50c29a0e36f62496e3ebae218d8df82741cd9 (patch)
tree0d52ade650418e1b5ac1c64ee2e99a259ef6485b /BlankConsoleLab
parentpsuedo-code created (diff)
downloadcst116-lab1-alexandra-apetroaei-1de50c29a0e36f62496e3ebae218d8df82741cd9.tar.xz
cst116-lab1-alexandra-apetroaei-1de50c29a0e36f62496e3ebae218d8df82741cd9.zip
part 2
Diffstat (limited to 'BlankConsoleLab')
-rw-r--r--BlankConsoleLab/Lab1-Apetroaei.cpp16
1 files changed, 13 insertions, 3 deletions
diff --git a/BlankConsoleLab/Lab1-Apetroaei.cpp b/BlankConsoleLab/Lab1-Apetroaei.cpp
index 1edaa73..a45d674 100644
--- a/BlankConsoleLab/Lab1-Apetroaei.cpp
+++ b/BlankConsoleLab/Lab1-Apetroaei.cpp
@@ -14,19 +14,26 @@ int main()
float width;
float length;
float area;
+ float number;
float aspect_ratio;
float isStable = false;
while (isStable == false)
{
- cout << "Insert width (in centimeters): " << endl ;
+ cout << "Insert width (in centimeters): " << endl;
cin >> width;
- cout << "Insert length (in centimeters): " << endl ;
+ cout << "Insert length (in centimeters): " << endl;
cin >> length;
- cout << "You entered: " << width << "cm for width, and " << length << "cm for length" << endl;
+ else if (number >= 1 || <= 400)
+ {
+ cout << "Invalid input: Please enter a number between 1 and 400." << endl;
+ }
+ cout << "You entered: " << width << "cm for width, and " << length << "cm for length" << endl;
+
+
// Area formula
area = ((width * length) / 2) / 1000;
cout << "The area of the kite is: " << area << "in square meters" << endl;
@@ -43,6 +50,9 @@ int main()
{
cout << "Aspect ratio:" << aspect_ratio << endl;
}
+
+
+
return 0;
}