Write a looping program that presents user with three option

Assignment Help Programming Languages
Reference no: EM131251267

Assignment

Instructions: The following programming problem can be solved by a program that uses three basic tasks-Input Data, Process Data, and Output Results. To process the data, it uses loops, arrays, decisions, accumulating, counting, searching and sorting techniques. Use RAPTOR to design a suitable program to solve this problem.

Problem Statement

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.

Option three is self explanatory. NEVER call "main" from inside your program. Use a loop that keeps your program running until the user chooses option 3.

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. Again, NEVER call "main" from inside your program. Also, do not use "recursion" in this program (submodules that call themselves). You are only allowed to use looping techniques to repeat sections of your submodules.

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: EM131251267

Questions Cloud

Differences between analytical and emergent approaches : What are differences between analytical/planned and emergent approaches? - To what extent does either (or a mix of these) reflect your practical experience?
Evaluation of effectiveness of the services you identified : A description of the services in your local community that support individuals in later adulthood. An evaluation of the effectiveness of the services you identified. A description of service gaps you identified. An explanation of how to improve exist..
Management is considering preparing segmented information : Suppose that management is considering preparing segmented information but is unsure on how to identify a segment and is unsure on why the information is important. Outline a brief memo to management explaining the importance of segmented information..
Is it likely that the exchange rate undershoots : How does this affect the extent to which the exchange rate overshoots when the money supply first increases? Is it likely that the exchange rate undershoots?
Write a looping program that presents user with three option : Write a looping program that presents the user with 3 options. When the first option is selected, sort the Players array in alphabetical order, keeping the Scores array parallel.
Describe how you could apply the information you learned : Describe how you could apply the information you learned in the article to your current or future work situation. Is there an advocacy, communication approach, or other alternative method that could be implemented to address the issue or concern me..
Different responses of u.s. compared with brazilian prices : Assuming that other factors affecting the money markets did not change too dramatically, how do these numbers match up with the predictions of this chapters model? How would you explain the apparently different responses of U.S. compared with Braz..
Which corporations exhibited a differentiation advantage : Which corporations exhibited a Differentiation Advantage? Which corporations exhibited a Cost Advantage? - Which competitive advantage is more sustainable Cost Advantage or Differentiation Advantage? Please explain.
Classifications such as tool reimbursements and wages : Motor vehicle service technicians usually must provide their own tools as part of their employment. These tools are the property of the technician, and service technicians generally receive an hourly wage. Some automobile dealerships split service te..

Reviews

Write a Review

Programming Languages Questions & Answers

  Write the program by using ias instruction set

Using IAS instruction set, write the program for this problem. Ignore fact that IAS was designed to have only 1000 words of storage.

  Program for class quiz to implement measurable interface

State a class Quiz to implement Measurable interface. A quiz has a score and a letter grade (such as B+).

  Design stored procedure to accept optional parameters

Design a stored procedure named spBalanceRange that accepts three optional parameters. Procedure returns a result set consisting of VendorName, InvoiceNumber and Balance for each invoice with a balance due

  Discussion: html/css

Discussion: HTML/CSS,  "JavaScript Placement"  Please respond to the following: Compare and contrast the process of adding JavaScript and a Cascading Style Sheet to a Website. Determine if they can be used simultaneously in a page. If so, explain wh..

  Within a computing investigation

Within a computing investigation, the ability to perform a series of steps again and again to produce the same results is known as ???a. repeatable findings

  Determine the hidden cost if a recursive algorithm is

question 1 explain which one you should choose memoized-cut-rod or cut-rod. defend your decision by explaining the

  Creating a package delivery system

CS-224: Object Oriented Programming & Design Methodologies Assignment. For this assignment, you will be  creating a package delivery system. You need to think in terms of objects. The first object is the delivery truck that can store 50 liters of p..

  Write program which computes amount of money earn

Write a program which computes amount of money person would earn over period of time if his or her salary is one penny the first day, two pennies the second day.

  Reducing the average memory access time

Suppose that increasing the line size to 128 bytes increases the H to 0.97. Does this reduce the average memory access time?

  Program that uses for loop prompt user to input two integers

Write a program that uses for loop to preform the following steps: Prompt the user to input two integers: firstnum and secondnum.

  Determine branch folding for unconditional branches

Determine the improvement from branch folding for unconditional branches. Assume a 90% hit rate, a base CPI without unconditional branch stalls of 1.

  Evaluate the arithmetic expressions

Prepare a Lisp program to evaluate the arithmetic expressions - If the input is legal, your program should output the final result of the expression evaluation, as given in the above case. If the input is illegal, the result is undefined, i.e., you..

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