summaryrefslogtreecommitdiff
path: root/BlankConsoleLab
diff options
context:
space:
mode:
authorHannah Wu <[email protected]>2022-10-26 00:04:19 -0700
committerHannah Wu <[email protected]>2022-10-26 00:04:19 -0700
commit1bc8e69d18701a038b5ea1ea86d4b400ce173d27 (patch)
tree5d917d0fb2623e88fa9163497dd74e1276d31b97 /BlankConsoleLab
parentadded printout of inputs (diff)
downloadcst116-lab1-wu-1bc8e69d18701a038b5ea1ea86d4b400ce173d27.tar.xz
cst116-lab1-wu-1bc8e69d18701a038b5ea1ea86d4b400ce173d27.zip
replaced integers with float. added calculations for printing area in square meters.
Diffstat (limited to 'BlankConsoleLab')
-rw-r--r--BlankConsoleLab/BlankConsoleLab.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/BlankConsoleLab/BlankConsoleLab.cpp b/BlankConsoleLab/BlankConsoleLab.cpp
index cd57d54..5da2bc7 100644
--- a/BlankConsoleLab/BlankConsoleLab.cpp
+++ b/BlankConsoleLab/BlankConsoleLab.cpp
@@ -12,7 +12,7 @@ using std::endl;
int main()
{
- int width, length;
+ float width, length;
cout << "Enter the width of the kite in meters." << endl;
cin >> width;
@@ -22,5 +22,13 @@ int main()
cout << "You have entered " << width << " for width." << endl;
cout << "You have entered " << length << " for length." << endl;
+
+ float areacm = (width * length/2);
+ float areamt = (areacm / 10000);
+
+ cout << "The area of the kite in square meters is " << areamt << endl;
+
+
+
}