Write a looping program that present user with three options

Assignment Help Data Structure & Algorithms
Reference no: EM131149256

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.

Round the Average score to the nearest whole number, as shown in the output example above.

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 and lowest scores. Nor simply sort the array by score and use the lowest and highest indexes. These must be discovered through algorithm that will work on an unsorted array. NOR may you "hard code" the number for the average score. Accumulate the scores in a loop then calculate the average. If the array data is changed, the Hi/Low/Avg scores should automatically be found or calculated with the new data.

Hard-code the values of the arrays into your program. Do NOT ask the user to input the values.

Other Requirements:

• Documentation: Use the "Comments" feature to document each symbol in the flowchart. You do this by right-clicking the symbol and selecting "Comment." Be sure to identify the data type of each variable used. Be sure to explain what each formula does. Be sure to explain what each of the other symbols in the flowchart does in a comment.

• Test and debug your Program: Create sample input data, run the program, then check your answers with a calculator or Excel. If something did not match up, then fix your program.

• Program must execute and produce correct output.

• Read this page again to be sure you covered all requirements.

• See the Programming Project Rubric for grading principles.

• 1) Add an option to the menu with code that allows the user to type in a Player's name and then displays the Player's score. 2) Use files to input your array data.

Reference no: EM131149256

Questions Cloud

Prepare a research paper on feminist or care ethics : repare a three-page research paper on feminist/care ethics and do the following: - Define feminist/care ethics.- Provide a brief history on the subject.
What is the fund net asset value : The Capitalist Mutual Fund's portfolio is valued at $48 million. The fund has liabilities of $4 million, and the investment company sponsoring the fund has issued 1,600,000 shares. What is the fund's net asset value
What is the grammar and sentence structure like : Consider what you read in the Unit III lecture concerning exegesis. Take into consideration every element that might affect how you interpret the piece of text for your art. What is your cultural lens through which you are reading the text? (Think..
Should the behavior be fixed : Choose a deviant behavior (based on society and not religion) and research it online. Discuss this behavior using Strain Theory, Cultural Transmission Theory, or Differential Association Theory. Should the behavior be "fixed?" Why, or why not?
Write a looping program that present user with three options : Process Data, and Output Results. To process the data, it uses loops, arrays, decisions, accumulating, counting, searching and sorting techniques. Write a looping program that presents the user with 3 options:
How actions of executive personally affect your life : explain how the actions of the executive and/or judicial branches have personally affected your life.- Think about how you have been personally impacted by a Supreme Court decision.
Which information is required on food labels : Which of the following information is required on food labels? Most health insurance policies in the United States are sold to
Identify major historical developments in world cultures : Explain how key social, cultural, and artistic contributions contribute to historical changes. Explain the importance of situating a society's cultural and artistic expressions within a historical context.
Will rapidly changing technology create more problems : In a post of at least 200 words, describe what you believe will be the major ethical concerns of the future. Will rapidly changing technology create more problems? Will medical advances give us additional issues to ponder? Will globalization cause..

Reviews

Write a Review

Data Structure & Algorithms Questions & Answers

  Conceptual model entity relationship diagram

Assume you are asked you to create a new entity-relationship diagram for a corporation for a customized shipment tracking system.

  Write algorithm find intersection of two singly-linked list

Write an algorithm (pseudocode) to find the intersection of two singly-linked lists. Assume that the data in each list are in nondecreasing order.

  Explain the functions of a network node manager

Describe the processes that take place during network discovery and mapping

  Write a program that uses the bubble sort algorithm

You need to write a program that uses the bubble sort algorithm and load data into an array and then sort it into ascending order. It should output the first five and last five numbers from the file both before and after the sort.

  Implement the rabin

Implement the Rabin - Karp matcher and Boyer Moore string matching algorithm. Give analysis for pattern matching in firewall which algorithm is best.Write A algorithm and program and show the oputput of the program

  Describes the steps required to perform the task specified

Write an algorithm in structured English (pseudocode) that describes the steps required to perform the task specified. Some examples of pseudocode can be found athttp://www.unf.edu/~broggio/cop2221/2221pseu.htm

  Basic heap operations

Heap This question is designed to help you get a better understanding of basic heap operations. You will be given queries of 3 types:• "1 v" -Add an element v to the heap.• "2 v" -Delete the element v from the heap.• "3" -Print the minimum of all the..

  Describe main tenets of theory and how they affect behavior

Describe the main tenets of the theory and how they affect behavior.

  Microsoft project file work breakdown structure

Update the Microsoft Project file you created in Assignment 1: VoIP Part 2 (Work Breakdown Structure) with the following changes

  Algorithms to insert entry into list and find entry in list

In array is pointer to linked list of nodes each of which starts with corresponding letter. Write algorithms to insert the entry into list and to find entry in the list.

  Analyze case asymptotic complexity of making interference

Analyze the worst-case asymptotic complexity of making an interference graph, for a program of size N (with at most N variables and at most N control-flow nodes).

  What is a linear implementation

What is a linear implementation? What kind of implementation of the ADT table is appropriate for retrieval-dominated applications, if the maximum size of the table is known? Why

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