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
cluponka [151]
3 years ago
9

Create an application that writes a series of random numbers to a file. Each random number should be in the range of 1 through 1

00. The application should let the user specify how many random numbers the file will hold and should use a SaveFileDialog control to let the user specify the file’s name and location.
Computers and Technology
1 answer:
natali 33 [55]3 years ago
8 0

Answer:

The following code is written in C# programming language:

private void saveButton_Click(object sender, EventArgs e)

       {

               StreamWriter usersFile;

        int randomNumberAmount =int.Parse(inputTextBox.Text.ToString());;

               int randomNumber = 0;

               int count = 1;

               while (count <= randomNumberAmount)

               {

                   Random rand = new Random();

                   randomNumber = rand.Next(100) + 1;

                   count++;

               }

               if (saveFile.ShowDialog() == DialogResult.OK)

                   {

                       usersFile = File.CreateText(saveFile.FileName);

                       usersFile.WriteLine("Random Number " + count + "is: " + randomNumber + "\r\n");

                   }

                   else

                   {

                       MessageBox.Show("Operation cancelled!");

                   }

              }

Explanation:

Here, we define a class, then we create an object of the StreamWriter.

Then, we create three integer variable and initialize the value init.

Then, we set the while loop and pass the condition.

Then, we set the if condition and check the condition and create following body init.

Then, we create the else part of the if condition.

You might be interested in
Write an algorithm to calculate the average<br> value of array of integer elements
amid [387]

Answer:

Explanation: Input : arr[] = {1, 2, 3, 4, 5}

Output : 3

Sum of the elements is 1+2+3+4+5 = 15

and total number of elements is 5.

So average is 15/5 = 3

Input : arr[] = {5, 3, 6, 7, 5, 3}

Output : 4.83333

Sum of the elements is 5+3+6+7+5+3 = 29

and total number of elements is 6.

So average is 29/6 = 4.83333.

7 0
3 years ago
Which term describes an approach to security similar to defense in depth in that it supports multiple layers, but uses a differe
miss Akunina [59]

Answer:

The answer to this question is Diversity of Defense.

Explanation:

Diversity of defense:- It is an approach for security which supports multiple layers but the catch here is that at each layer a different mechanism of security is used or at most of the layers.The idea is that you do not need to have multiple layers of defense but different defenses also.  

So we conclude that the answer to this question is Diversity in Defense.

3 0
3 years ago
Firewalls labeled as appliances are intended to be easy to use. <br> a. True <br> b. False
katovenus [111]
<span>Firewalls labeled as appliances are intended to be easy to use. The answer is (a) TRUE. These firewalls as appliances imply that you simply plug them in and they work on its own. The user or administrator does not need to be an expert on how these firewalls work, similar to many home appliances that we simply plug in and they work by themselves. </span>
7 0
3 years ago
(ACCESS 2016)
galben [10]

Explanation:

rowCount() returns the number of rows affected by the last DELETE, INSERT, or UPDATE statement executed by the corresponding PDOStatement object.

7 0
3 years ago
Read 2 more answers
Introduction or background of corporal punishment in schools
tensa zangetsu [6.8K]

Answer:

Corporal punishment is a discipline method in which a supervising adult, such as a teacher, deliberately inflicts pain upon a child in response to a child's unacceptable behavior or inappropriate language. The goals of this type of punishment are usually to halt the offense immediately, prevent it from happening again, and set an example for others.

3 0
3 years ago
Other questions:
  • The different between a compiler and a translaror
    9·2 answers
  • A computer professional who has access to sensitive information shares this information with a third party. Which professional c
    9·2 answers
  • Which of the following is an example of an analog medium?
    13·1 answer
  • Invalid length parameter passed to the LEFT or SUBSTRING function (below)".
    6·1 answer
  • What component is most likely to be installed in a PC, is considered primary storage, and typically stores the operating system,
    6·1 answer
  • The smallest unit of storage is​
    15·1 answer
  • Which three factors should be discussed before planning and building a project?
    15·1 answer
  • Which entity might hire a Computer Systems Analyst to help it catch criminals?
    12·2 answers
  • The four differences between binary and denary​
    13·1 answer
  • What is a security strategy comprised of products and services that offer remote support for mobile devices, such as smart phone
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!