Oscar A.

asked • 03/29/20

Add two more statements to main() to test inputs 3 and -1. Use print statements similar to the existing one (don't use assert).

Add 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;

}


1 Expert Answer

By:

Saqib H. answered • 03/29/20

Tutor
5.0 (48)

PhD in Computer Science with expertise in Python

Still looking for help? Get the right answer, fast.

Ask a question for free

Get a free answer to a quick problem.
Most questions answered within 4 hours.

OR

Find an Online Tutor Now

Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.