Explore BrainMass
Share

Programming: Array Sorting And Calculations

This content was STOLEN from BrainMass.com - View the original, and get the already-completed solution here!

Write a C++ program that declares an array alpha of 50 components of the type double. Initialize the array so that the first 25 components are equal to the square of the index variable and the last 25 components are equal to three times the index variable. Output the array so that 10 elements per line are printed.

© BrainMass Inc. brainmass.com October 24, 2018, 6:10 pm ad1c9bdddf
https://brainmass.com/computer-science/cpp/c-programming-plus-plus-arrays-strings-33491

Solution Summary

This solution provide a C++ program.

$2.19
See Also This Related BrainMass Solution

Please modify this program so the application can handle multiple items.

Please modify this program so the application can handle multiple items.
Use an array to store the items.

The output should display the information one product at a time, including the item number, the name of the product, the number of units in stock, the price of each unit, and the value of the inventory of that product. In addition, the output should display the value of the entire inventory.

? Create a method to calculate the value of the entire inventory.
? Create another method to sort the array items by the name of the product.

View Full Posting Details