Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Computer Engineering Expert

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.

Computer Engineering, Engineering

  • Category:- Computer Engineering
  • Reference No.:- M91904721

Have any Question?


Related Questions in Computer Engineering

A very skilled court stenographer makes two typographical

A very skilled court stenographer makes two typographical errors (typo) per hour, on average. 1. What probability distribution is most appropriate for calculating the probability of a given number of typos being made by ...

A banks assets equal its liabilities under a both

A bank's assets equal its liabilities under a. both 100-percent-reserve banking and fractional-reserve banking. b. 100-percent-reserve banking but not under fractional-reserve banking. c. fractional-reserve banking but n ...

Short answer1 what must be installed or prepared to utilize

Short answer: 1. What must be installed or prepared to utilize Windows Remote Management (WinRM) on a Windows Server 2012 R2? 2. What is the PowerShell command to check the status of Windows Remote Management (WinRM)? 3. ...

Write a program that populates an array named weekday from

Write a program that populates an array named weekday from the string SunMonTueWedThuFriSat, and then prints each day in uppercase. PERL Language.

Question the below table shows the instruction count ic for

Question : The below table shows the instruction count (IC) for programs running on three processors P1, P2, and P3 with the clock rates 1.0 GHz, 2.5 GHZ, and 2.0 GHz respectively. Each program consists of only Load/stor ...

What statistic was calculated to determine differences

What statistic was calculated to determine differences between the intervention and control groups for the lumbar and femur neck BMDs? Were the groups significantly different for BMDs?

Your solution will entail writing a function called

Your solution will entail writing a function called TimeDifference and a test main that demonstrates that you can compute the time difference in minutes between the two times. TimeDifference is a function that receives a ...

Question suppose your il license encodes your name sex and

Question : Suppose your IL license encodes your name, sex, and birthday month/year which can be used by police officers and bouncers to determine if you are who your license says you are. What kind of encoding would this ...

C programmingneed help with a c program arrayrearrangec

***C PROGRAMMING*** Need help with a C program array_rearrange.c that rearranges an integer array. The array will be split into two sets of integers one by one. A new array will be created by append the first set to the ...

Ambrose has indifference curves with the equation x2 k -

Ambrose has indifference curves with the equation x2 = k - 4(x^0.5) ... Where the larger "k" is, the higher the indifference curve. If good 1 is drawn on the horizontal axis, and good 2 on the vertical... What is the SLO ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As