so I'm trying to write a code that calculates the volume of a rectangular prism and I'm asking the user to input length, width and height.
after this i'm suppose to increase the length and width of whatever the user entered by 2...
how do i go about doing this? I'm still confused on using ++ and -- in mathematical expressions.
This is what i have so far:
(the second part doesn't work...)
double recPrismVolume; //variable for rectangle prism volume
double recPrismVolumeNew; // variable for second prism volume
cout << "Please enter the height of your rectangular prism: \n ";
cin >> height;
cout << "Enter length: \n";
cin >> length;
cout << "Enter width: \n";
cin >> width ;
recPrismVolume = height * length * width; // formula for rectangular
prism volume
cout << "This rectangular prism has a volume of " << recPrismVolume <<
endl;
recPrismVolumeNew = length++ * width++ * height; //we will add two to whatever the user
//has entered for length and width
cout << "The new rectangular prism volume is " << recPrismVolume <<
endl;