

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
namespace FileWriter
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void btnCreate_Click(object sender, EventArgs e)
{
try
{
//write code that assigns the value in the textbox to an Integer
variable
if // write code that validates whether or not the data entered in
the textbox is greater than or equal to 1 *
{
try
{
SaveFileDialog saveFileDialog1 = new SaveFileDialog();
saveFileDialog1.Filter = "txt files (*.txt)|*.txt|All files
(*.*)|*.*";
saveFileDialog1.FilterIndex = 1;
saveFileDialog1.CheckFileExists = false;
saveFileDialog1.InitialDirectory = //complete the code for the
InitialDirectory property
saveFileDialog1.RestoreDirectory = true;
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
string strFileName = saveFileDialog1.FileName;
FileStream fileOut = new FileStream(strFileName,
FileMode.Create);
StreamWriter writer = new StreamWriter(fileOut);
//Create an object of the Random class
Random rand = new Random();
int randomNumber = rand.Next(0, 100);
for (/* program a loop condition that repeats a number of times
equal to the number entered in the textbox */
{
//write code that generates a random number and writes it into the
.txt file
writer.WriteLine(randomNumber.ToString());
}
//close the writer object
}
}
catch
{
MessageBox.Show("Error saving the changes to the data file.",
"Error Saving Data", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
}
else
{
MessageBox.Show("Please enter an integer greater than zero");
}
}
catch
{
MessageBox.Show("Please enter an integer greater than zero");
}
}
}
}
Design

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using System.IO;
namespace FileWriters
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void btnCreate_Click_1(object sender, EventArgs e)
{
}
private void btnCreate_Click(object sender, EventArgs e)
{
try
{
// assign value from text box to integer variable
int number = Int32.Parse(txtNumber.Text);
if (number > -1)
{
try
{
SaveFileDialog saveFileDialog1 = new SaveFileDialog();
saveFileDialog1.Filter = "txt files (*.txt)|*.txt|All files
(*.*)|*.*";
saveFileDialog1.FilterIndex = 1;
saveFileDialog1.CheckFileExists = false;
saveFileDialog1.InitialDirectory = Application.StartupPath;
saveFileDialog1.RestoreDirectory = true;
if (saveFileDialog1.ShowDialog() == DialogResult.OK)
{
string strFileName = saveFileDialog1.FileName;
FileStream fileOut = new FileStream(strFileName,
FileMode.Create);
StreamWriter writer = new StreamWriter(fileOut);
//Create an object of the Random class
Random rand = new Random();
int randomNumber;
for (int i = 0; i < number; i++)
{
//write code that generates a random number and writes it into the
.txt file
randomNumber = rand.Next(0, 100);
writer.WriteLine(randomNumber.ToString());
}
//close the writer object
writer.Close();
}
}
catch
{
MessageBox.Show("Error saving the changes to the data file.",
"Error Saving Data", MessageBoxButtons.OK,
MessageBoxIcon.Error);
}
}
else
{
MessageBox.Show("Please enter an integer greater than zero");
}
}
catch
{
MessageBox.Show("Please enter an integer greater than zero");
}
}
private void btnExit_Click(object sender, EventArgs e)
{
this.Close();
}
}
}

Using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; u...
Please use Python for this program
Random Number File Writer Write a program that writes a series of random numbers to a file. Each random number should be in the range 1 through 500. The program should let the user specify how many random numbers to put into the file. The name of the file to write to should be 'random.txt'. Submit the random.txt file generated by your program with the assignment. Sample program execution: Python 3.4.3 Shell Eile Edit...
I need help in Python. This is a two step problem So I have the code down, but I am missing some requirements that I am stuck on. Also, I need help verifying the problem is correct.:) 7. Random Number File Writer Write a program that writes a series of random numbers to a file. Each random number should be in the range of 1 through 500. The application should let the user specify how many random numbers the file...
Read your notes concerning 2D arrays with particular attention to the syntax of passing arrays as parameters to functions. Write the pseudocode (algorithm) for the following program definition: A text file contains a square matrix of integer numbers. The file contains an integer number indicating the identical number of rows and columns followed by the data itself (that number cannot be larger than 100). For example, a file containing a 3x3 matrix would contain 3 followed by 9 other integer...
Write a python program and pseudocode The Program Using Windows Notepad (or similar program), create a file called Numbers.txt in your the same folder as your Python program. This file should contain a list on floating point numbers, one on each line. The number should be greater than zero but less than one million. Your program should read the following and display: The number of numbers in the file (i.e. count them) (counter) The maximum number in the file (maximum)...
Select the correct answer. (1) Which of the following will open a file named MyFile.txt and allow you to read data from it? (a) File file = new File("MyFile.txt"); (b) FileWriter inputFile = new FileWriter(); (c) File file = new File("MyFile.txt"); FileReader inputFile = new FileReader(file); (d) FileWriter inputFile = new FileWriter("MyFile.txt"); (2) How many times will the following do - while loop be executed? int x = 11; do { x...
This is a JAVA language The files provided in the code editor to the right contain syntax and/or logic errors. In each case, determine and fix the problem, remove all syntax and coding errors, and run the program to ensure it works properly. Note: DebugData2.txt does not need to be edited. It is used by the program. DebugData2.txt 435-9845 239-9845 981-9883 384-5656 875-3784 874-8120 DebugThirteen2.java // Program reads in a file of phone numbers without area codes // inserts "(312)...
If necessary, create a new project named Intermediate24 Project and save it in the Cpp8\Chap14 folder. Also create a new source file named Intermediate24.cpp. If you are using Microsoft Visual C++, copy the Intermediate24.txt file from the Cpp8\Chap14 folder to the Cpp8\Chap14\Intermediate24 Project folder. Use a text editor to open the Intermediate24.txt file, which contains payroll codes and salaries. Close the Intermediate24.txt file. Create a program that allows the user to enter a payroll code. The program should search for...
I need help writing these 2 programs please include all the indents :) In this programming challenge you are to create two Python programs: randomwrite.py andrandomread.py. One program, randomwrite.py, is to write a set of random numbers to a file. The second program, randomread.py, is to read a set of random numbers from a file, counts how many were read, displays the random numbers, and displays the total count of random numbers. Random Number File Writer (randomwrite.py) Create a program...
CIST 2371 Introduction to Java Unit 03 Lab Due Date: ________ Part 1 – Using methods Create a folder called Unit03 and put all your source files in this folder. Write a program named Unit03Prog1.java. This program will contain a main() method and a method called printChars() that has the following header: public static void printChars(char c1, char c2) The printChars() method will print out on the console all the characters between c1 and c2 inclusive. It will print 10...
There is a file called mat2.txt in our files area under the Assignments folder. Download it and save it in the same folder where this Matlab file (HW08_02.m) is saved. It may be worth opening that text file to see how it is set out. Note well, however, that the file might have a different number of lines and different number of numbers on each line. Write a Matlab program that does the following: Prompt the user for an input...