Answer:
#include <iostream>
int main() {
double height, length, width;
double volume;
// Get input from user
std::cout << "Enter height: ";
std::cin >> height;
std::cout << "Enter length: ";
std::cin >> length;
std::cout << "Enter width: ";
std::cin >> width;
// Calculate volume
volume = (height * length * width) / 2;
// Print result
std::cout << "Volume: " << volume << std::endl;
return 0;
}
Step-by-step explanation:
In C++, you can define multiple varibles of the same type in one line i.e. "double height, length, width". They'll all have a default value of null. Also, you should use doubles or floats to account for decimals. As well, the line
cout << wedgeVolume = (height * length * width) /= 2; wouldn't work because you cant print out a defintion as your defining it. You'd need to seperate the solving of the volume and the printing of the volume to get the code you have to work.