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

  Write schedule produced by earliest deadline first algorithm

Given below are two sets of real-time, periodic tasks. For (a), will the schedule produced by Earliest Deadline First algorithm meet all the deadlines?

  Write a program that reads a file and builds a linked list

Write a program that reads a file and builds a linked list. After the list is built display it on monitor. You may use any appropriate data structure, but it should have a key field and data. Two possibilities are a list of your favourite CD's or ..

  Write a program to implement a linear linked list

Write a C/C++ program to implement a singly linear Linked List

  Find the average number of bits needed to encode

Suppose that the symbols are compressed using Huffman Coding and that the most likely symbol is encoded as a 0, determine the decompressed value of the following compressed string of bits?

  Implement an open hash table

In this programming assignment you will implement an open hash table and compare the performance of four hash functions using various prime table sizes.

  Advantage of fast running time of insertion sort

Running time of quicksort can be enhanced in practice by taking advantage of fast running time of insertion sort when its input is "nearly" sorted.

  Which algorithm should be most efficient

the test conditions are equal for both algorithms, which algorithm should be most efficient when N is arbitrarily large (i.e., you can select N to be as large as you want it to be)?

  Find combination of projection and inverse projection map

Find the combination of projection and inverse projection maps which finds all authors by whom I have horror books

  Creating financial tracking program

Acme Inc. is making next generation financial tracking program, and Alice has been provided the task of writing encryption component.

  Instance of the single source shortest paths

instance of the single source shortest paths problem with vertex a as the source

  Draw a hierarchy chart and then plan the logic for a program

Draw a hierarchy chart and then plan the logic for a program for the sales manager of The Couch Potato Furniture Company. The manager needs a program to determine the profit on any item sold. Input includes the wholesale price and retail price for..

  Towers of hanoi problem

Solving the Towers of Hanoi Problem using State Space Search- There are 3 disks on peg A. The top disk has a diameter of 1, the middle disk has a diameter of 2, and the bottom disk has a diameter of 3

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