Question: Language is C++ 3. Sorting Parts Refer to Part structure introduced in the textbook. It has 3 attributes: modelnumber, year, and price. Define this structure,

Language is C++
3. Sorting Parts Refer to Part structure introduced in the textbook. It has 3 attributes: modelnumber, year, and price. Define this structure, and then create an array of parts type. Write functions to take input, sort, and then finally display the sorted array. Function Description input(Part parts[], int N): takes input for all the parts. sort(Part parts[], int N): sorts the array of parts, in ascending order based on their prices. display(Part parts[], int N): displays the array. Sample Case Details Sample Input For Custom Testing 3 100 45 2019 20 65 2020 70 20 2012 Sample Output Price: 20, Part No. : 65, Part Model: 2020 Price: 70, Part No.: 20, Part Model: 2012 Price: 100, Part No. : 45, Part Model: 2019 Explanation First row is size (N) of array. You must create array of that size. Subsequently there are N rows, each having price, part number, and model number. Array is sorted and displayed in ascending order of price
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
