dd two more statements to main() to test inputs 3 and -1. Use print statements similar to the existing one (don't use assert). #include using namespace std; // Function returns origNum cubed int CubeNum(int origNum) { return origNum * origNum * origNum; } int main() { cout << "Testing started" << endl; cout << "2, expecting 8, got: " << CubeNum(2) << endl; /* Your solution goes here */ cout << "Testing completed" << endl; return 0; }
dd two more statements to main() to test inputs 3 and -1. Use print statements similar to the existing one (don't use assert).
#include <iostream>
using namespace std;
// Function returns origNum cubed
int CubeNum(int origNum) {
return origNum * origNum * origNum;
}
int main() {
cout << "Testing started" << endl;
cout << "2, expecting 8, got: " << CubeNum(2) << endl;
/* Your solution goes here */
cout << "Testing completed" << endl;
return 0;
}
#include <iostream>
using namespace std;
// Function returns origNum cubed
int CubeNum(int origNum) {
return origNum * origNum * origNum;
}
int main() {
cout << "Testing started" << endl;
cout << "2, expecting 8, got: " << CubeNum(2) << endl;
/* Your solution goes here */
cout << "Testing completed" << endl;
return 0;
}
Step by step
Solved in 4 steps with 2 images