summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdwardFine <[email protected]>2022-10-05 16:17:52 -0700
committerEdwardFine <[email protected]>2022-10-05 16:17:52 -0700
commit50c570dd81633e5f40e172f1efd11e6eeea7946e (patch)
treee93293d7a9168240f107835a9bcfdaf8431b2265
parentPrompt for Length and Width (diff)
downloadcst116-lab1-edwardfine-50c570dd81633e5f40e172f1efd11e6eeea7946e.tar.xz
cst116-lab1-edwardfine-50c570dd81633e5f40e172f1efd11e6eeea7946e.zip
Print inputted values and loops until inputted right.
-rw-r--r--BlankConsoleLab/BlankConsoleLab.vcxproj.filters2
-rw-r--r--BlankConsoleLab/CST116-Lab1-Fine.cpp15
2 files changed, 11 insertions, 6 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.vcxproj.filters b/BlankConsoleLab/BlankConsoleLab.vcxproj.filters
index aca1dd9..2736ba9 100644
--- a/BlankConsoleLab/BlankConsoleLab.vcxproj.filters
+++ b/BlankConsoleLab/BlankConsoleLab.vcxproj.filters
@@ -15,7 +15,7 @@
</Filter>
</ItemGroup>
<ItemGroup>
- <ClCompile Include="BlankConsoleLab.cpp">
+ <ClCompile Include="CST116-Lab1-Fine.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
diff --git a/BlankConsoleLab/CST116-Lab1-Fine.cpp b/BlankConsoleLab/CST116-Lab1-Fine.cpp
index b46897c..bf098cb 100644
--- a/BlankConsoleLab/CST116-Lab1-Fine.cpp
+++ b/BlankConsoleLab/CST116-Lab1-Fine.cpp
@@ -13,11 +13,16 @@ int main()
{
int length;
int width;
+ int correct = 0;
+ while (correct == 0) {
+ cout << "How long is your kite in centimeters? ";
+ cin >> length;
+ cout << endl << "How wide is your kite in centimeters? ";
+ cin >> width;
+ cout << endl << "Your kite is " << length << "cm long and " << width << "cm wide? 1=Yes/ 0=No ";
+ cin >> correct;
+ endl;
+ }
- cout << "How long is your kite in centimeters? ";
- cin >> length;
- cout << endl << "How wide is your kite in centimeters? ";
- cin >> width;
-
}