Menu

[Solved] Language C Part Create Print Two Arrays Sure First Allowed Hard Code Arrays Program Also P Q37264772

The language is C++

Part I:

Create and print out the two arrays: (Be sureto do this first) You are allowed to hard code these arrays intoyour program. You can also put the data into a file and read theinformation into the program. The data is as follows:

Anne 150

Bob 250

Ralph 305

Tim 250

Barbara   85

Jane 160

Steve 180

Tom 210

Mike 165

Shirley 155

Pam 125

Frank 130

Part II: The elevators in our building have an1100 lb. load limit. Determine which people in the list above geton the elevator. Print their names, weights, total weight, and howmany got on.

Part III: Rearrange these people inasscending sequence by weight and printthe two arrays. Determine again how many may ride theelevator, printing out their names, weights, total weight and thenumber of how many people got on.

Part IV: Rearrange these people indescending sequence by name (USE A DIFFERENT SORTALGORITHM THAN THE ONE YOU USED IN PART III) and print thetwo arrays. Determine again how many may ride theelevator, printing out their names, weights, total weight and thenumber of how many people got on.

Part V: Have the program determine which methodallowed the most people to get on the elevator. The program shouldcompare the three different counts of how many people got on theelevator in each of the scenarios above – with the weight array asgiven, with the weight array in ascenging order, with the namearray in descending order.

This program should include:

  • 2 different sort functions

  • a function to determine how many people get on the elevator(will be called 3 times)

  • a print function which prints both arrays (include a sizeparameter and it can be called 6 times).

Make sure all methods are writen to handle n elements, not just12. You can pass 12 from main to n in the method/function.

Read the data from a file and put the results on anoutput file. Print the output file using Notepad or some othereditor.

Expert Answer


Answer to The language is C++ Part I: Create and print out the two arrays: (Be sure to do this first) You are allowed to hard code… . . .

OR


Leave a Reply

Your email address will not be published. Required fields are marked *