Task I:
Create a simple calculator for the four arithmetic operations for real numbers.
Recommendations:
1. Create a project in Windows Forms in MS Visual Studio.
2. When entering fractional numbers, use the fractional separator depending on the Windows regional settings (semicolon).
3. Use the try statement to handle exceptions for incorrect data entry.
4. Processing of Click events for operation buttons is as follows (example for the + button):
- try
{
textBox3->Text = Convert.ToDouble(textBox1->Text) + Convert.ToDouble(textBox2->Text).ToString();
}
catch...
{
textBox3->Text = "Error";
}
5. Perform the remaining operations in the same way, replacing + with -, *, and /.