summaryrefslogtreecommitdiff
path: root/BlankConsoleLab/Lab1-Apetroaei.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'BlankConsoleLab/Lab1-Apetroaei.cpp')
-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;
}