For each of the following, write C++ statements that perform the specified task. Assume that unsigned integers are stored in four bytes and that the starting address of the built-in array is at location 1002500 in memory.

a) Declare an unsigned int built-in array values with five elements initialized to the even integers from 2 to 10. Assume that the constant size has been defined as 5.
b) Declare a pointer vPtr that points to an object of type unsigned int.
c) Use a for statement to display the elements of built-in array values using array sub-
script notation.
d) Write two separate statements that assign the starting address of built-in array values
to pointer variable vPtr.
e) Use a for statement to display the elements of built-in array values using pointer/offset notation


```
a) unsigned int values[SIZE]{2, 4, 6, 8, 10};
b) unsigned int* vPtr;
c) for (int i{0}; i < SIZE; ++i) {
cout << setw(4) << values[i];
}
d) vPtr = values; and vPtr = &values[0];
e) for (int i{0}; i < SIZE; ++i) {
cout << setw(4) << *(vPtr + i);
}
```

Computer Science & Information Technology

You might also like to view...

Critical Thinking QuestionsCase F-2In reviewing his insurance company's website, Mr. George notices that viewers must scroll to view information on a page. Mr. George would like to eliminate as much of the scrolling as possible. He asks the company's web designer if this is possible and is told that his request can be completed by using named anchors. In creating named anchors for the insurance company's website, the designer plans the strategic locations where the anchors will appear and chooses appropriate names. What name is acceptable?

A. #Top B. top C. 1top# D. All of the above

Computer Science & Information Technology

An interface should:

a. be “transparent” to the user. b. provide control to the people who use it. c. allow the user to move about within the project. d. provide access to the “media” in the project. e. all of the above.

Computer Science & Information Technology

If you save a webpage as a bookmark, by default, the browser will identify the webpage by its title.?

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

Computer Science & Information Technology

Which of the following MUST be implemented to share metrics between routing protocols within the same router?

A. Routing loop B. Routing table C. Route redistribution D. Dynamic routes

Computer Science & Information Technology