(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 // allows program to perform input and output
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";
```

Computer Science & Information Technology

You might also like to view...

An administrator has configured an alarm to be notified when a virtual machine meets two conditions: high virtual CPU high active memory consumption The alarm is malfunctioning and triggering when either condition is met instead of both. What can be done to correct the issue?

A. Edit the alarm and select Trigger if ALL of the following conditions are satisfied. B. Edit the alarm and select Trigger if ANY of the following conditions are satisfied. C. Create two separate alarms, one for CPU and one for memory. D. Delete the existing alarm and create a new event based alarm.

Computer Science & Information Technology

Answer the following statement(s) true (T) or false (F)

1. You can click a history state on the History panel to revert an image to the state it was in when you performed that action. When you do, the states beneath that action appear dimmed on the History panel. _________________________ 2. The Magnetic Lasso Tool selects the outline of a complex object on a low contrast background. _________________________ 3. An RGB image has a composite RGB color channel and two individual color channels. _________________________ 4. In an alpha channel, black indicates the selection. _________________________

Computer Science & Information Technology