Create sample input data then check answers with calculator

Assignment Help Programming Languages
Reference no: EM131740455

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 Python to write 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
9         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 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. These must be discovered through algorithms.

You may NOT "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 "Comments" to document your code.

• 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: EM131740455

Questions Cloud

What is the split between the circuit courts : This case actually is the consolidation of two cases. At issue in both cases is the calculation of the workday for the purposes of distinguishing between.
Describe in detail list of quality assurance considerations : Refine and describe in detail the list of quality assurance considerations that you determined in the Discussion Board to be ranked highest.
Simulate a bouncing switch : Debouncing Circuit ENGR 360: Hardware Description Languages - Simulate a bouncing switch, sw, and a debounced switch output
Basketball players heights are distributed according to n : Basketball players heights are distributed according to N (80in,36in 2) Golf players heights are distributed according to N
Create sample input data then check answers with calculator : 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.
Solving problem of the save-a-lot grocery store : Tort Liability. Tammy was shopping in Save-a-Lot Grocery Store when Stewart, an employee, brushed Tammy's ankle with a grocery cart.
Neglect signaling and clientele effects : What are the advantages and disadvantages of the residual policy don't forget neglect signaling and clientele effects.
Significance and contribution to the body of knowledge : Researchers must be able analyze research studies to determine their significance and contribution to the body of knowledge
Determining the contractual liability : Contractual Liability For several years, Albert acted as a collection agent for Paulette. Recently, Paulette revoked Albert's authority to collect payments.

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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