1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
asambeis [7]
3 years ago
14

Ask the user how many high scores they want.

Computers and Technology
1 answer:
Alex3 years ago
6 0

Answer:

Check the explanation

Explanation:

As per requirement submitted above kindly find below solution.

Here new console application in C# is created using visual studio 2019 with name "HighScoreApp". This application contains a class with name "Program.cs".Below is the details of this class.

Program.cs :

//namespace

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Threading.Tasks;

//application namespace

namespace HighScoreApp

{

class Program //C# class

{

//entry point of the program , Main() method

static void Main(string[] args)

{

//declaring variable to store number of score

int numberOfScores = 0;

//using while loop

while(numberOfScores<=0)

{

//asking user number of high scores

Console.WriteLine("Enter number of high scores : ");

//reading input

numberOfScores = int.Parse(Console.ReadLine());

}

//declaring array with number of scores

int[] scores = new int[numberOfScores];

//asking user high scores using for loop

for (int i = 0; i < scores.Length; i++)

{

//asking high scores

Console.WriteLine("Enter score "+(i+1)+" : ");

//reading score

scores[i] = int.Parse(Console.ReadLine());

}

Console.WriteLine();//used for new line

Console.WriteLine("High Scores -Unsorted");

//call function to print each element

PrintArray(scores);

//call method to sort the array elements

scores = SortArrayHighToLow(scores);

Console.WriteLine();//used to print new line

Console.WriteLine("High Scores-Sorted");

PrintArray(scores);//call method to print array elements

Console.SetCursorPosition(0, Console.WindowHeight - 1);

Console.WriteLine("Press ENTER to continue....");

Console.ReadLine();

}

//method to print the array

public static void PrintArray(int [] scoresArray)

{

//using for loop , print each score

for (int i = 0; i < scoresArray.Length; i++)

{

Console.WriteLine(scoresArray[i]);//print each high score

}

}

//method to sort the array

public static int [] SortArrayHighToLow(int[] scoresArray)

{

Array.Sort(scoresArray);

return scoresArray;

}

}

}

==================================

Output :Run application using F5 and will get the screen as shown below

Kindly check the below Screenshot for Output :Program.cs

You might be interested in
The value that decides whether something falls into one category or another is called a ____
alexandr402 [8]

Dichotomous variables

Explanation:

A variable is any characteristics, number, or quantity that can be measured or counted. A variable may also be called a data item.

3 0
3 years ago
A wide-angle lens corrected for barrel distortion is called a(n)<br> lens.
Sonja [21]

Answer:

Rectilinear lens

Explanation:

In photography, the distortions are caused in the formation of the image due to either the position of the camera or the optical design of the lenses i.e perspective and optical distortion.

The barrel distortion is a type of optical distortion caused due to the optical design of the lens. In barrel distortion, the straight lines of the light bend as a result of which the lines appear curved inwards in images.  

The field of view of wider than the image sensor in barrel distortions which can be corrected by the use of rectilinear lens which provides straight lines without bending them. This lens stretches the image towards the edge and removes distortion.

Thus, Rectilinear lens is the correct answer.

3 0
3 years ago
The ______ is the information center that drivers need to refer to when they're NOT scanning the road.
Arisa [49]

Answer:

C. instrument panel

Explanation:

In order to be able to operate your vehicle safely, you must know the functions and locations of all the interior mechanisms of your car.

The instrument panel contains gauges which include the following:

Speedometer, which indicates speed in both miles and kilometers per hour

Tachometer, which indicates rotations in the engine in revolutions per minute (RPMs)

Odometer, which indicates the total number of miles your car has been driven since it was manufactured

Fuel gauge, which shows the fuel level in your car's fuel tank

Oil gauge, which shows oil level

5 0
3 years ago
why do programs include keyboard shortcuts for certain actions? do you prefer the mouse or the keyboard/ why?
Archy [21]
I would prefer the shortcut because it would make it easier to open tabs and close them too. but the can also help you with other stuff to .
4 0
4 years ago
Anyone help me with number 41.
Katarina [22]
It is te = t I yhink
8 0
3 years ago
Other questions:
  • Which of the following are advantages of a local area network, as opposed to a wide area network? select three options
    15·1 answer
  • During the Requirements Definition stage of a systems development​ project, the employees who will be the primary users of the n
    15·1 answer
  • A search engine is the same as a browser.<br> \
    11·1 answer
  • is either the number of bits used to indicate the color of a single pixel, or the number of bits used for each color component o
    7·1 answer
  • In a _______ format, the date line and the signature block are centered.
    6·1 answer
  • III. FILL-IN THE BLANK (five points each)
    14·1 answer
  • Which type of formatting would you apply to spreadsheet data so that each cell is outlined?
    5·1 answer
  • I want to make apps but I don't know how and which things I have to learn first ,so if you know mention from starting to ending​
    11·1 answer
  • The distance between two walls is called what?
    8·2 answers
  • Which tool might be useful if you want to design a scratch game for preschoolers that avoids asking them to read instructions
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!