I am trying to build a program to calculate the total volume of a tin can given the input variables, and then using the total volume, calculate the price of how much it would cost to fill it, given the input price per pound, but it is not working. Can somebody please tell me what mistakes I am making?

#include <iostream>
using namespace std;
int main()
double volume, weight, fillerCost, height, thickness, radius, totalCost, density, pi;
pi = 3.14159;
density = 0.095486 * volume;
weight = volume * density;
totalCost = fillerCost * weight;
cout << "Welcome to the Volume Calculator!" << endl;
cout << "Please type in the total radius(in inches):";
cin >> radius >> endl;
cout << "Please type in the height(in inches):";
cin >> height >> endl;
cout << "please type in the thinkness of the tin(in inches):";
cin >> thickness >> endl;
volume = (pi * radius) * (height - 3.14159) pow((radius - thickness)2.0) * (height - (2.0 * thickness));
cout << "Please enter the cost per pound of filler material";
cin >> fillerCost >> endl;
return 0;
The first mistake I see is that you're trying to use endl with an input stream, endl is only defined to work with output streams.

Next in future please use code tags when posting code, and if you have compile errors cut and past those errors into your post as well. Be sure to post all the error messages, exactly as they appear in your development environment.

Registered users can post here. Sign in or register to post.