(Table) Using only the techniques you learned in this chapter, write a program that calcu- lates the squares and cubes of the integers from 0 to 10 and uses tabs to print the following neatly formatted table of values:
What will be an ideal response?
```
#include
using namespace std;
int main()
{
int number; // integer to square and cube
number = 0; // set number to 0
cout << "integer\tsquare\tcube\n"; // output column heads
// output the integer, its square and its cube
cout << number << '\t' << number * number << '\t'
<< number * number * number << "\n";
number = 1; // set number to 1
cout << number << '\t' << number * number << '\t'
<< number * number * number << "\n";
number = 2; // set number to 2
cout << number << '\t' << number * number << '\t'
22 << number * number * number << "\n";
23
24 number = 3; // set number to 3
cout << number << '\t' << number * number << '\t'
<< number * number * number << "\n";
number = 4; // set number to 4
cout << number << '\t' << number * number << '\t'
<< number * number * number << "\n";
```
You might also like to view...
To associate text with a control element, you can use the label element..
Answer the following statement true (T) or false (F)
Create focus on slides with large pictures that help the audience relate to the topic
Indicate whether the statement is true or false
A grouped object can be saved as a picture file
Indicate whether the statement is true or false
Answer the following statement(s) true (T) or false (F)
1. Power loss is an impact while a natural disaster is a threat. 2. An asset can be an indirect target of an event. 3. A list of controls and threats can be obtained from the NIST SP800-53 standard. 4. A defined scale can be assigned to a previously implemented control. 5. The probable loss magnitude in the FAIR framework is equivalent to the magnitude of the worst impact.