C++ program 5 Requirements Each menu option should be a separate function. Your program should use 2 vectors. You can declare the vectors as global variables so each function can access them. One vector should store ints and the other vector should store strings. Use the integer vector to store the phone number for a contact. Use the string vector to store the name of a contact. Option 1 should allow a user to add a number and a name to the respective vectors. Option 2 should allow a user to enter a name. Your program should respond by showing the contacť's number. Option 3 should show all stored contacts (name and number). Your program should loop until the user selects Option 4. Your program should use exception handling (try/catch) to validate input. Contact numbers should be all numeric (no dashes). Contact names should be only alphabetic characters. If either of these rules are violated, your program should throw an Exception. A message describing the error should be coded in the Catch block. Hint, you learned formulas for determining integers and ascii characters in an earlier lesson.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

TRY to do it under 40-50 minutes

 

Attach code and output screenshots

C++ program 5
Requirements Each menu option should be a separate function. Your program should
use 2 vectors. You can declare the vectors as global variables so each function can access
them. One vector should store ints and the other vector should store strings. Use the
integer vector to store the phone number for a contact. Use the string vector to store the
name of a contact.
Option 1 should allow a user to add a number and a name to the respective vectors.
Option 2 should allow a user to enter a name. Your program should respond by
showing the contact's number.
Option 3 should show all stored contacts (name and number). Your program should
loop until the user selects
Option 4. Your program should use exception handling (try/catch) to validate input.
Contact numbers should be all numeric (no dashes). Contact names should be only
alphabetic characters. If either of these rules are violated, your program should throw
an Exception. A message describing the error should be coded in the Catch block.
Hint, you learned formulas for determining integers and ascii characters in an earlier
lesson.
Transcribed Image Text:C++ program 5 Requirements Each menu option should be a separate function. Your program should use 2 vectors. You can declare the vectors as global variables so each function can access them. One vector should store ints and the other vector should store strings. Use the integer vector to store the phone number for a contact. Use the string vector to store the name of a contact. Option 1 should allow a user to add a number and a name to the respective vectors. Option 2 should allow a user to enter a name. Your program should respond by showing the contact's number. Option 3 should show all stored contacts (name and number). Your program should loop until the user selects Option 4. Your program should use exception handling (try/catch) to validate input. Contact numbers should be all numeric (no dashes). Contact names should be only alphabetic characters. If either of these rules are violated, your program should throw an Exception. A message describing the error should be coded in the Catch block. Hint, you learned formulas for determining integers and ascii characters in an earlier lesson.
Expert Solution
steps

Step by step

Solved in 3 steps with 4 images

Blurred answer
Knowledge Booster
Array
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education