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

  Use ms project to complete a gantt chart

Gantt Chart: Use MS Project to complete a Gantt Chart that shows your work to date so far on this project based on the first two team submissions. This chart should show reasonable tasks, durations, and dependencies, look professional, and be prin..

  What data type would you use to store a phone number

What data type would you use to store a phone number? A dollar amount? What is the difference between a while loop and a do..while loop? What two things do you need to use in order to ask a user for input?

  Linked lists give a program to implement the insert

give a program to implement the insert operation and delete operations on a queue using linked

  Design a linear algorithm

The Russian flag problem is to rearrange an array of characters R, W, and B so that R is the first character, R is followed by a W, W is followed by a B, B is followed by another R, and the pattern repeats. Design a linear algorithm (pseudo code)..

  Algorithm to read arbitrary number of data records

Write the algorithm to read arbitrary number of data records, each comprising name, age, and code.

  The binary search algorithm

- The "origin" of the Cartsian plane in math is the point where x and y are both zero. Declare a variable of type POINT named origin and set its data dields consistent with the mathematical notion of "origin".

  Question about lan and wan

Think about the following two scenarios two computers are connected to a LAN using a total of 20-feet of cable, and two computers are connected over the Internet and are 8000 miles from each other.

  Write the problem out using pseudo-code that would support

Identify a programming paradigm, and write the problem out using pseudo-code that would support that paradigm.

  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

  Provide definitions of all terms acronyms and abbreviations

Provide a description and scope of the software and explain the goals, objectives and benefitsof your project. This will provide the basis for the brief description of your product.

  What do you mean by query evaluation plan what are its

question 1 what is a query evaluation plan? what are its advantages and disadvantages?question 2 discuss the different

  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