Create a program that allows a user to select one of the following four menu options:

a. Enter New Integer Value

b. Display Pointer Address

c. Display Integer Address

d. Display Integer Value

For this program you will need to create two variables: one integer data type and one pointer. Using indirection, assign any new integer value entered by the user through an appropriate pointer.

Sure! Here's an example of a program that allows a user to select one of the four menu options you mentioned:

```C++
#include <iostream>

int main() {
int integerValue; // Declare an integer variable
int* pointer = nullptr; // Declare a pointer variable and initialize it to nullptr

char choice;
do {
// Display menu options
std::cout << "Menu Options:" << std::endl;
std::cout << "a. Enter New Integer Value" << std::endl;
std::cout << "b. Display Pointer Address" << std::endl;
std::cout << "c. Display Integer Address" << std::endl;
std::cout << "d. Display Integer Value" << std::endl;
std::cout << "Enter your choice (a, b, c, d): ";
std::cin >> choice;

switch (choice) {
case 'a':
// Enter new integer value
std::cout << "Enter a new integer value: ";
std::cin >> integerValue;
pointer = &integerValue; // Assign the address of integerValue to pointer
break;

case 'b':
// Display pointer address
std::cout << "Pointer Address: " << pointer << std::endl;
break;

case 'c':
// Display integer address
std::cout << "Integer Address: " << &integerValue << std::endl;
break;

case 'd':
// Display integer value using the pointer (indirection)
std::cout << "Integer Value: " << *pointer << std::endl;
break;

default:
std::cout << "Invalid choice. Please try again." << std::endl;
}

std::cout << std::endl;

} while (choice != 'q'); // Loop until user enters 'q' to quit

return 0;
}
```

Explanation:

1. We start by including the necessary header `<iostream>` for input and output streams.
2. The program begins with the `main()` function.
3. We declare two variables: `integerValue` of type `int` to hold the integer value, and `pointer` of type `int*` (pointer to an integer) and initialize it to `nullptr` (null pointer) for safety.
4. Inside the `do-while` loop, we display the menu options using `std::cout` and get the user's choice using `std::cin`.
5. Based on the user's choice, we use a `switch` statement to perform the appropriate action.
6. For option 'a', we prompt the user to enter a new integer value and assign it to `integerValue`. Then, we assign the address of `integerValue` to `pointer` using the address-of operator `&`.
7. For option 'b', we simply output the value of `pointer`, which represents its memory address.
8. For option 'c', we use the address-of operator `&` to get the address of `integerValue` and output it.
9. For option 'd', we use the dereference operator `*` to access the value stored at the memory location pointed to by `pointer` and output it.
10. The default case handles invalid choices by informing the user to try again.
11. The loop continues until the user enters 'q' to quit.
12. Finally, the program exits by returning 0 from the `main()` function.

This program allows the user to interactively perform the desired operations based on the given menu options.