Question: Directions Write a program that uses an array of nested structs to store the addresses for your store's customers. Each customer has a name and


Directions Write a program that uses an array of nested structs to store the addresses for your store's customers. Each customer has a name and two addresses: home address and business address. Each address has a street, city, state, and zip code 1. Data structure a. b. Define an Address struct with street, city, state and zip fields Define a Customer struct with lastNm and firstNm fields, plus homeAddr and busAddr fields of type Address Declare an array of type Customer c. 2. Use a menu-driven program with the following selections a. Enter new customer b. Display all customers Display a particular customer d. c. Exit the program Define the following 5 functions 3. a. int displayMenu( Outputs the menu selections Inputs the users selection Validates that the user has entered a valid selection b. Customer getCustomer); Asks the user to input the customer's first name, last name and the two addresses and stores in a single Customer struct c. void showCustomer(Customer) Outputs the information for a single Customer struct d. Address getAddress(); Asks the user to enter each component of the address (street, city, state and zip) and stores in a single address struct Note that street will contain embedded blanks, so you will need to use getline. Since you are mixing cin and getline, you will need to use cin.ignore to skip over the last endline character in the input prior to using getline void findCust(Customer[l, int); Asks the user to enter a customer's first and last names Searches the array of Customers for a match If there is a match, prints out all information for the particular customer If not match, prints an error message e. Sample Output Visual Studio 20121Projects Topic7Structs Debug Topi. elect fron the menu belou 1 Enter neu custoner 2 Display all custoners Diaplay a particular cutoner 4:Exit progran nter custoner first nane: Nancy nter Business Addreaa nter street address: 444 nter city: Dayton 3rd St nter zip code: 454g2 nter Hone Rddresa nter street address: 1800 Meadow Dr ter city: Beavercreek nter state OH nter zip code: 45431 uatoner Contacts Menu elect fron the menu be lou 1 Enter new custoner 2 Diaplay all custonera Display a particular cutoner : Exit progran nter custoner first nane: Bil nter custoner laat nane Snith nter Business Address nter street address: 200 Pentago Blud nter city: Beavercreek nter state: OH nter zip code:45432 nter Hone Address nter street address 128 Forest Dr nter city: Beavercreek nter state: nter zip code: 45432 ustoner Contacts Menu elect fron the menu belou 1 Enter neu custoner Display all custoners Display a particular cutoner 4: Exit progran uatoner nane: Nancy Jones usiness address: 144 u 3rd St. Dayton. OH 45482 1u Headow Dr. Beavercreek. OH 45431 one address: ustoner nane: Bill Snithh Busineas address: 200 Pentago Blvd. Beavercreek, OH 45432 1728 Porest DBeavercreek, OH 45432
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
