131k views
5 votes
You are working as a Software Programmer for one of the big retail company. You need to implement the program that can store at least 15 customer information using the Array concept. You need to implement the individual array to store each of below field. CustomerName CustomerAddress1 City State Zip Once the data is stored in the array, then you need to loop thru the entire zip loop and print all the zip code on the command line.

User Tterrace
by
3.0k points

1 Answer

4 votes

Answer:

The C++ code is given below with appropriate comments. Random names of customer information are chosen as samples

Step-by-step explanation:

#include <iostream>

using namespace std;

int main()

{

// Initialize String Arrays for customerName,customerAddress1,city,state,zip for 15 customers

string customerName[15] = {"Liam","Noah","William","James","Logan","Benj","Mason","Elijah","John","Patty","Cheryl","Nick","Brian","Steve","mark"};

string customerAddress1[15] = {"Liam - Address1","Noah - Address2","William - Address3","James - Address4","Logan - Address5","Benjamin - Address6","Mason - Address7","Elijah - Address8","John - Address9","Patty - Address10","Cheryl - Address11","Nick - Address12","Brian - Address13","Steve - Address14","mark - Address15"};

string city[15] = {"Sitka","Juneau","Wrangell","Anchorage","Jacksonville","Anaconda","Oklahoma City","Fort Worth","Dallas","Sitka","Juneau","Wrangell","Anchorage","Jacksonville","Anaconda"};

string state[15] = {"Alaska","Alaska","Alaska","Alaska","Florida","Montana","Montana","Oklahoma","Texas","Arizona","Tennessee","California","Virginia","Indiana","Virginia"};

int zip[15] = {30041,36602,75062,78952,12071,55874,11236,44512,55262,99874,11020,55820,11304,11587,11047};

// Print Zips for the customers

cout <<"Customer Names"<<"\t"<< "Zip Code"<< "\\";

for (int i = 0; i < 15; i++)

cout <<customerName[i]<<"\t\t\t"<< zip[i] << "\\";

}

User Stefano Bafaro
by
2.9k points