//Code by Rayyan Ansari, modified by Jordan Harris-Toovy, October 2021 #include #include using namespace std; using std::ios; int main() { float radius; float height; float pi = 3.14159265; float volume; cout << "Please enter the radius of the Cylinder: "; cin >> radius; //Fixed missmatched variables cout << endl; cout << "Please enter the height of the Cylinder: "; cin >> height; //Fixed missmatched variables cout << endl; volume = radius * radius * pi * height; if (volume > 0) { cout << "The volume of a cylinder with height " << height << " and radius " << radius << " is "; cout.setf(ios::fixed); //Fixed missing colon cout << setprecision(3) << volume; } else { cout << "Volume cannot be negative"; } }