Use either the bubble sort or the selection sort algorithms

Assignment Help Data Structure & Algorithms
Reference no: EM13842177

Assume the Scores array is parallel to the Players array (both arrays are below).

Scores array

Scores[0] = 198

Scores[1] = 486

Scores[2] = 651

Scores[3] = 185

Scores[4] = 216

Scores[5] = 912

Scores[6] = 173

Scores[7] = 319

Scores[8] = 846

Scores[9] = 989

Players Array

Players[0] = "Joe"

Players[1] = "Ann"

Players[2] = "Marty"

Players[3] = "Tim"

Players[4] = "Rosy"

Players[5] = "Jane"

Players[6] = "Bob"

Players[7] = "Lily"

Players[8] = "Granny"

Players[9] = "Liz"

Write a looping program that presents the user with 3 options:

1) Sort Output by Players

2) Sort Output by Scores

3) Exit Program

When the first option is selected, sort the Players array in alphabetical order, keeping the Scores array parallel. Add code that determines the highest and lowest scores in the list. Include code to display each player's score and name in the sorted order. Below the sorted list display the highest and lowest scores in the list and the name of the player who received that score. Your sort by Player output display should look like this:

Scores Sorted by Player:

486 Ann

173 Bob

846 Granny

912 Jane

198 Joe

319 Lily

989 Liz

651 Marty

216 Rosy

185 Tim

 

989 Highest Score by Liz

173 Lowest Score by Bob

When the second option is selected, sort the Scores array in numerical order, keeping the Players array parallel. Add code that determines the average score of the entire list. Include code to display each player's score and name in the sorted order. Below the sorted list display the average of all scores in the list. Your sort by Scores output display should look like this:

Players Sorted by Scores:

173 Bob

185 Tim

198 Joe

216 Rosy

319 Lily

486 Ann

651 Marty

846 Granny

912 Jane

989 Liz

 

498 Average Score

You may use either the Bubble Sort or the Selection Sort algorithms.

You MUST use Modular Programming techniques by using Sub Modules (Sub Charts in RAPTOR) in your program. Your "main" module should not be very large.

You may NOT "hard code" the numbers for highest, lowest and average scores. These must be discovered through algorithms. If the array data is changed, these should automatically be calculated with the new data.

Reference no: EM13842177

Questions Cloud

A program that tests the users ability to memorize : a program that tests the user's ability to memorize a sequence of colors
What is the effect of attending a peer nutrition : What is the effect of attending a peer nutrition counseling program on college students' knowledge of healthy food three months later
An application that instantiates five librarybook object : Write an application that instantiates five LibraryBook objects
What is the return for stock d : What is the dollar amount invested in stock B if the beta of the portfolio is 1.2 - The portfolio has a return of 19.8 percent. The return for Stock A is 6.5 percent, for Stock B is 33.2 percent, and for Stock C is 7.2 percent. What is the return f..
Use either the bubble sort or the selection sort algorithms : use either the Bubble Sort or the Selection Sort algorithms
Prepare a year-end statement of financial position : Prepare journal entries to record these events and transactions. Be sure to indicate the fund-type in which the entry would be made. Prepare a year-end statement of financial position and statement of activities.
Would you say awareness of consumers attitudes is enough : Questions: Would you say awareness of consumers' attitudes is enough to have a positive affect human rights
Write a program to load an array : Write a program to load an array
What is the main theme of the righteous mind : What is the main theme of The Righteous Mind by Jonathan Haidt? What are 2 to 3 similarities between The Righteous Mind and Sam Harris' book Free Will?

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  What are the benefits of linked lists and objects in

what are the advantages of linked lists and objects in program development and design? how does python utilize these

  Organization and explain of database security

In many cases, there are different users that connect to a database. Views are virtual tables based on the physical data. They are usually used either to simplify queries by combining tables or for security purposes to limit the access of data to ..

  Write a pseudocode for divide-and-conquer algorithm

Write a pseudocode for divide-and-conquer algorithm for the exponentiation problem of computing where a>0 n is a positive integer

  Write a pseudocode for a recursive version of binary search

Write a pseudocode for a recursive version of binary search

  Write true if the statement is true or false

It is impossible to over-train a multi-layer feed-forward network using the back-propagation learning algorithm. It is guaranteed that the longer you train your system, the more accurate it will perform.

  Write algorithm to reverse elemens in queue

Using basic queue and stack operationns, write algorithm to reverse elemens in the queue. Suppose that 'Stack' is class described in section with 'StackType' set to int and STACK_CAPACITY

  Diagram of a telephone network

Consider a diagram of a telephone network, which is a graph G whose vertices represent switching centers, and whose edges represent communication lines joining pairs of centers. Edges are marked by their bandwidth, and the bandwidth of a path is the ..

  Design time randomized monte carlo algorithm

You have to design an O(n) time randomized Monte Carlo algorithm which computes an (1 + o)- approximate ham-sandwich cut with probability 1 - n-c for any given constant c > 0.

  Consider you want to demonstrate a decision treetable to

consider you want to demonstrate a decision treetable to someone who has never seen one. think of a scenario with two

  Determinethe assymtotic complexity

Determinethe assymtotic complexity (Big Theta) int terms of n (not sum) for the following code fragment in the average case.

  Sort scheduling algorithms according to high throughput

Sort the scheduling algorithms (FCFS, SPF, RR, MLFB) according to each of High throughput (if we take averages of time intervals smaller than the sum of all processes' time)

  Research two other sorting algorithms and describe how they

research two other sorting algorithms and describe how they work. describe how two different searching algorithms work.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd