This program is written in pseudocodeDesign a program that asks the user to enter 10 golf scores. The scores should be stored in an Integer array. Sort the array in ascending order and display its contents.I'm having trouble with understanding arrays and how they're used. I've seen a lot of exmamples of this program but they're all vastly different and I'm not sure where to begin.

Question
Asked Oct 22, 2019
142 views

This program is written in pseudocode

Design a program that asks the user to enter 10 golf scores. The scores should be stored in an Integer array. Sort the array in ascending order and display its contents.

I'm having trouble with understanding arrays and how they're used. I've seen a lot of exmamples of this program but they're all vastly different and I'm not sure where to begin.

check_circle

Expert Answer

Step 1

Few key points related to Arrays:

  • Arrays occupy contiguous memory locations and are of fixed size. The size can’t be increased or decreased dynamically while running the program.
  • Arrays index starts with 0. Suppose if an Array size is 3, then it’s index are 0,1 and 2.
  • The index numbers are used to store and access Array elements. Example,

 char Array[3]      //Declares a character Array of size 3 with index numbers 0,1 and 2.

 Array[0] = a        //character ‘a’ is stored at index 0

 Array[1] = b        //character ‘b’ is stored at index 1

 Array[2] = c         //character ‘c’ is stored at index 2

Step 2

Few points related to sorting

  • There exist many sorting algorithms like quicksort, merge sort, bubble sort, heap sort, selection sort, insertion sort, etc.
  • Bubble sort is the easiest sorting algorithm that sort num...

Want to see the full answer?

See Solution

Check out a sample Q&A here.

Want to see this answer and more?

Solutions are written by subject experts who are available 24/7. Questions are typically answered within 1 hour.*

See Solution
*Response times may vary by subject and question.
Tagged in

Engineering

Computer Science

Related Computer Science Q&A

Find answers to questions asked by student like you

Show more Q&A add
question_answer

Q: EXPLAIN ALL STEPS: Determine the output of the following Pep/9 machine language program if the input...

A: Address   Instruction(in hex)0000         D1FC15Convert the instructions into binary form-D=11011=00...

question_answer

Q: USING THE CYK ALGORITHM, prove that the String w= abbbaa is in the language / the member of the give...

A: Given a context-free grammar: G and a string w– G = (V, ∑, P, S)where » V  is finite set of variable...

question_answer

Q: In a file called RemoveVowels.java, write a program that: Asks the user to enter a word of text. Pr...

A:  First of all to import java.util.scanner object to use Scanner class. In java, you need to use the ...

question_answer

Q: c. Outline an algorithm for finding the largest key in a B-tree.

A: B-tree is a data structure tree that sorts the data, allows insertion and deletion, searching, and s...

question_answer

Q: Please explain how you solve the follwing problem:

A: a) Set of nullable variables is {A, B, C} as A and C will be null for productions A -> λ and C-&g...

question_answer

Q: What are the advantages of fiber optics over copper as a transmission medium?

A: Advantages of Fiber Optic Cables over Copper Wires are:Fiber optic cables are less expensive than co...

question_answer

Q: The following data fragment occurs in the middle of a data stream for which the byte-stuffing algori...

A: Byte stuffing algorithm, also referred as Character stuffing algorithm was invented to overcome the ...

question_answer

Q: Business example: Precision Tools sells a line of high-quality woodworking tools. When customers pla...

A: Context diagram:The Context Diagram shows the system being viewed as a single high-level entity and ...

question_answer

Q: What are the risks associated with a pervasive security infrastructure? What are the reasons for NOT...

A: Pervasive security infrastructure refers to cloud security risks. As many users possibly from differ...