cube.cpp 1 #include "cube.h" 2 3 4 5 cube.h 1 2 3 4 6 7 8 9 Tester.cpp 9 10 11 12 13 14 15 16 17 1 #include 2 #include 3 using namespace std; 4 5 #include "cube.h" 6 7 8 18 19 #ifndef CUBE H #define CUBE H 20 21 // Write your functions here #endif int main() { } cout << "cube (2.5): << cube (2.5) << endl; cout << "Expected: 15.625" << endl; cout << "cube (7): " << cube (7) << endl; cout << "Expected: 343" << endl; "1 cout << "cube (9.8): << cube (9.8) << endl; cout << "Expected: 941.1920000000002" << endl; cout << "cube (5.9): " << cube (5.9) << endl; cout << "Expected: 205.37900000000002" << endl; cout << "cube (9): << cube (9) << endl; cout << "Expected: 729" << endl; "I cout << "cube (2): " << cube (2) << endl; cout << "Expected: 8" << endl;

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter8: Arrays And Strings
Section: Chapter Questions
Problem 19PE
icon
Related questions
Question

Need some help writing functions for this problem.

Write a pair of functions cube which return the cube of their arguments.

cube.cpp
1 #include "cube.h"
2
3
4
5
cube.h
1
2
3
4
56
7
8
9
Tester.cpp
3
4
5
6
7
8
9
10
1 #include <iostream>
2 #include <iomanip>
using namespace std;
#include "cube.h"
112134 15 16 7 18 19 28 21
17
#ifndef CUBE H
#define CUBE H
20
// Write your functions here
#endif
int main()
{
}
cout << "cube (2.5): " << cube (2.5) << endl;
cout << "Expected: 15.625" << endl;
cout <<
cout <<
cout <<
cout <<
cout <<
cout <<
cout <<
cout << "Expected:
cout << "cube (2):
cout << "Expected:
"cube (7): " << cube (7) << endl;
"Expected: 343" << endl;
"cube (9.8): " << cube (9.8) << endl;
"Expected: 941.1920000000002" << endl;
"cube (5.9): " << cube (5.9) << endl;
"Expected: 205.37900000000002" << endl;
"cube (9): " << cube (9) << endl;
729" << endl;
<< cube (2) << endl;
8" << endl;
Transcribed Image Text:cube.cpp 1 #include "cube.h" 2 3 4 5 cube.h 1 2 3 4 56 7 8 9 Tester.cpp 3 4 5 6 7 8 9 10 1 #include <iostream> 2 #include <iomanip> using namespace std; #include "cube.h" 112134 15 16 7 18 19 28 21 17 #ifndef CUBE H #define CUBE H 20 // Write your functions here #endif int main() { } cout << "cube (2.5): " << cube (2.5) << endl; cout << "Expected: 15.625" << endl; cout << cout << cout << cout << cout << cout << cout << cout << "Expected: cout << "cube (2): cout << "Expected: "cube (7): " << cube (7) << endl; "Expected: 343" << endl; "cube (9.8): " << cube (9.8) << endl; "Expected: 941.1920000000002" << endl; "cube (5.9): " << cube (5.9) << endl; "Expected: 205.37900000000002" << endl; "cube (9): " << cube (9) << endl; 729" << endl; << cube (2) << endl; 8" << endl;
Expert Solution
steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning