1. Engineering
  2. Computer Science
  3. c program pointers amp arrays reqs must use the...

Question: c program pointers amp arrays reqs must use the...

Question details

C++ program

pointers & arrays

reqs:

- must use the pointer pointing to the array when assigning values

- list must output in order from when they were added along with their position num in the array (please use pointer to do this)

- user input can only be nums from 0-9 (no symbols, letters, or special characters)

- program can't be hard-coded and has to ask the user to input exactly enough nums to fill the array (this must be done with the pointer)

---

Make a list that will hold 10 phone #s that are based on what the user inputs. User can only enter a phone # that ONLY have 0-9 (no dashers or symbols). Program will output an error if the the user inputs a phone # less than 10 nums or anything that isn't nums so then the program will get the user to input a valid phone #. The program will come to an end when all 10 slots of the list are filled. After the list is filled it will be printed and along w/ their position in the pointer that is pointing to the array.

---

ex:

Please enter in a phone number: 78f90fsd

Error. Numbers only.

Please enter in a phone number: 2749576942

Please enter in a phone number: 576390850455645654

Error. Phone number must be exactly 10 digits.  

Please enter in a phone number: 86578

Error, phone number must be exactly 10 digits.

Please enter in a phone number: 1111111111

Please enter in a phone number: 2222222222

Please enter in a phone number: 3333333333

Please enter in a phone number: 4444444444

Please enter in a phone number: 5555555555

Please enter in a phone number: 6666666666

Please enter in a phone number: 7777777777

Please enter in a phone number: 8888888888

Please enter in a phone number: 9999999999

Please enter in a phone number: 0000000000

0: 1111111111

1: 2222222222

2: 3333333333

3: 4444444444

4: 5555555555

5: 6666666666

6: 7777777777

7: 8888888888

8: 9999999999

9: 0000000000

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution