Question

Arrays Artistic Solutions wants to keep track of 100 of customers, including the following fields: Customer...

Arrays

Artistic Solutions wants to keep track of 100 of customers, including the following fields:

Customer ID

Last Name

First Name

Street Address

City

State

Zip Code

Phone Number

Email Address

Without access to a database program, you decide that keeping this information in one or more arrays is the best solution. The question is, what kind or kinds of arrays would you use? Discuss whether any or all of the following is suitable for this application, indicating why you would or would not use this kind of array:

A single array for all customers and all fields

Parallel arrays (what would you store in the different arrays?)

Multi-dimensional arrays (what you you store in the different dimensions?)

Can you answer the three questions in bold?

0 0
Add a comment Improve this question Transcribed image text
Answer #1

A single array for all customers and all fields
A single array is not a good option here.
Each customer has multiple fields, and you want to store the data of multiple customers,
so, using a single array for all customers and all fields is not suitable for this application.
Where as, if you insist, you can create a structure for each customer with the above fields,
and then you can use an array of 100 customers. But this doesn't mean using single array for
all customers and all fields.

Parallel arrays (what would you store in the different arrays?)
This works perfectly. For each field, you should create an array of 100 elements.
And accessing the data of ith customer simply means accessing the details of ith element
in each array you created. This is the best option of the three available, if you're not
into structures/linkedlists.

Multi-dimensional arrays (what you you store in the different dimensions?)
Multi-dimensional arrays is not an advisable option here. There problem is that, each
field may have its own datatype, like lastname, and firstname may have string datatype,
and zipcode, and customerID may have integer datatype. etc. In that case, the drawback of
arrays is that, it can store only similar type data, and different type of data cannot be
stored in arrays, and will not work here.
Whereas, if you are going to store all the data/fields in the same type assume string
(which is not a usual case), then multi-dimensional is much better than the previous option
parallel arrays.

Add a comment
Know the answer?
Add Answer to:
Arrays Artistic Solutions wants to keep track of 100 of customers, including the following fields: Customer...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT