diff options
author | Navan Chauhan <navanchauhan@gmail.com> | 2022-09-09 15:22:01 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-09 15:22:01 -0600 |
commit | e2ab34e60f544d9d6902fe3eb8e0947009234955 (patch) | |
tree | 0a93bb11a63e8dc62663925f7f90f41576229dc2 /hw2/almondMilk.cpp | |
parent | 6ae81ee58a1d2ffa8f8f5fe9dc45a8f064c31c4d (diff) |
Diffstat (limited to 'hw2/almondMilk.cpp')
-rw-r--r-- | hw2/almondMilk.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hw2/almondMilk.cpp b/hw2/almondMilk.cpp index 77bc61e..ffe3bf6 100644 --- a/hw2/almondMilk.cpp +++ b/hw2/almondMilk.cpp @@ -12,12 +12,12 @@ int main() { double side_len = 0;
double height = 0;
double volume = 0;
-
+ // User input
cout << "What is the side length of the base of the carton in inches?\n";
cin >> side_len;
cout << "What is the height of the carton in inches?\n";
cin >> height;
- volume = (side_len*side_len)*height*0.55;
+ volume = (side_len*side_len)*height*0.55; // Calculate and convert to ounces
cout << "The carton has a volume of " << fixed << setprecision(1) << volume<<" ounces.";
return 0;
}
\ No newline at end of file |