Answered You can hire a professional tutor to get the answer.

QUESTION

Directions This C++ program that will initialize 6 arrays of attributes for 10 stores in main. Each array will contain the values for one distinct...

Directions

This C++ program that will initialize 6 arrays of attributes for 10 stores in main. Each array will contain the values for one distinct attribute from the assigned stores. Each array will have the type that best accommodate the kind of attribute being stored. Like assignment 1, at least one attribute will be a string, one an integer, and one a floating point. The types of the other three attributes are at the discretion of the student. After declaration and initialization, all that the program will do is to call, from main, the following functions:

1. printable to print all data in the arrays properly labeled and aligned.

2. sortData to sort all 6 arrays in parallel

3. printable again to print all sorted data.

These functions above are described as follows:

printTable function

This function will receive the arrays that were defined in main and print a table containing the information contained within the array. Every row in the table will contain the information for the same store (10 rows) and every column will contain the information of the same attribute for all stores (6 columns with attributes). Print appropriate headers for the table and each column. Print an index number (from 1 to 10) in front of each row. All columns should be aligned.

sortData function

This function will receive the arrays that were defined in main and sort them based on one of your integer attributes from lower to higher value. Remember that you are sorting 6 arrays based on one of them, so you need to keep track and move the data inside all arrays in parallel to produce a correct sort. Do not forget to add comments to the code. The .cpp file must have a head of comments indicating the name of the file, the name of the author, and a brief description of the program. Each function must have also have a head of comments indicating the name of the function and a brief description of what it does. All variable names must also be documented.

Show more
LEARN MORE EFFECTIVELY AND GET BETTER GRADES!
Ask a Question