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

  Design a linear-time algorithm

Design a linear-time algorithm that verifies that the height information in an AVL tree is correctly maintained and that the balance property is in order.

  Determine the edge connectivity of an undirected multigraph

Give a polynomial-time algorithm for this decision problem - determine the edge connectivity of an undirected multigraph

  What is the machine run time in second for sorting array

Write computer program to implement this algorithm and demonstrate the results and what is the machine run time in second for sorting array A

  Measure the execution time of the three sorting algorithms

The program should display the array values before sorting and then after invoking each sorting method. For this case, consider SIZE value 100 and MAXRNG value 9999.

  Write a flowchart to print the largest of any 3 numbers

Write a flowchart to print the largest of any 3 numbers - Write a flowchart to print a product of 3 numbers.

  Design randomized algorithm for solving decoding problem

The Viterbi algorithm is a deterministic algorithm for solving the Decoding problem. Design a randomized algorithm for solving the Decoding problem.

  Use a circular linked list to implement the queue

use a circular linked list to implement the queue data structure as described in java

  Recursive tree algorithms

Write a recursive function to determine if a binary tree is a binary search tree.

  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

  Draw flowchart and execute the algorithm

Execute the algorithm below using 6 for "number" and Execute the algorithm below using 25 for "number" and draw a flowchart for the algorithm below and have it checked by the TA.

  Difference between workbook and worksheet

Discuss the difference between a workbook and a worksheet and explain why would you want to use individual worksheets when using Excel?

  Design analgorithm that decides for each node

Design an O(n) algorithm that decides (schedules) for each node at which time slot to start sending data such that the total number of time (slots) is minimized.

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