Type in the following main routine exactly as shown and add the definitions of two functions, cubeit0 and cubeit1, each

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899604
Joined: Mon Aug 02, 2021 8:13 am

Type in the following main routine exactly as shown and add the definitions of two functions, cubeit0 and cubeit1, each

Post by answerhappygod »

Type in the following main routine exactly as shown and add the
definitions of two
functions, cubeit0 and cubeit1, each that provides the cube of the
argument x. You
may not use the pow() math library function.
#include <iostream>
//Function cubeit0 goes here
//Function cubeit1 goes here
int main(void)
{ cout << "Input a number to be cubed: ";
double x;
cin >> x;
cout << cubeit0(x) << endl;
double result;
cubeit1(x,result);
cout << result << endl;
return 0;
}
Here is an example of how the program is intended to work:
% a.out
Input a number to be cubed: 3
27
27
%
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply