Must be able to cin feet and inches using project 1 and a text file output of the gallon amount and the dimensions. Project 1 #include #include using namespace std; int main() { // declare integers for equation int length, width, height, vol, gallons; // Get input for length cout << "Enter length: "; cin >> length; cout << endl; // Get input for width cout << "Enter width: "; cin >> width; cout << endl; // Get input for height cout << "Enter height: "; cin >> height; cout << endl; // Calculate for vol vol = length * width * height; // Calculate for gallons gallons = vol * 7.48; //Display volume in gallons cout << "the volume in gallons is, " << gallons << endl; return 0; }
Must be able to cin feet and inches using project 1 and a text file output of the gallon amount and the dimensions.
#include <iostream>
#include <cmath>
using namespace std;
int main() {
// declare integers for equation
int length, width, height, vol, gallons;
// Get input for length
cout << "Enter length: ";
cin >> length;
cout << endl;
// Get input for width
cout << "Enter width: ";
cin >> width;
cout << endl;
// Get input for height
cout << "Enter height: ";
cin >> height;
cout << endl;
// Calculate for vol
vol = length * width * height;
// Calculate for gallons
gallons = vol * 7.48;
//Display volume in gallons
cout << "the volume in gallons is, " << gallons << endl;
return 0;
}
Trending now
This is a popular solution!
Step by step
Solved in 3 steps