Question: Complete the following C# windows form application program. The form is composed of the following controls: Listbox (listBox1), TextBox (textBox1), Button (button1). The program should
Complete the following C# windows form application program. The form is composed of the following controls: Listbox (listBox1), TextBox (textBox1), Button (button1).
The program should calculate the factors of any NON-PRIME number when the user enters a number in texBox1 and click on button1, then the program should perform the following
If the user tries to click the button without entering a number, the program should display an appropriate error message.
If the user entered a prime number, the program should display an error message Prime Number is Not Allowed.
If the user enters a non-prime number, then clear the listbox.
calculate all the factors of the entered number and display them in listBox1
clear the textbox after the calculation.
Sample Output:
namespace Exam {
public partial class Form1 : Form {
public Form1() { InitializeComponent(); }
// Your answer goes here
}
Form1 Num 12 1 2 3 4 6 6 12 button1
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
