blob: 77bc61ed01f5b1e3de6f8a73ff3bca4e513c21c6 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
// CSCI 1300 Fall 2022
// Author: Navan Chauhan
// Recitation: 307 – TA name
// Homework 2 - Problem 3
#include<iostream>
#include<iomanip>
using namespace std;
int main() {
double side_len = 0;
double height = 0;
double volume = 0;
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;
cout << "The carton has a volume of " << fixed << setprecision(1) << volume<<" ounces.";
return 0;
}
|