VP Calculator
VP Calculator
VP Calculator
Button 0-9
Buttons Operators
Backspace button
Clear button
± button
% button
Ceil Button
Floor Button
Square Button
Cube Button
1/x Button
MOD Button
Log Button
Sin Button
Cos Button
Tan Button
Pi Button
Exponential Button
TanH Button
CosH Button
SinH Button
OFF Button
Output
Here is the output in which I have performed basic multiplication and used the square
root method.
Multiplication
Input
5*5
Expected output:
25
Square Root
Input
25
Expected Output
5
using System;
using System.Windows.Forms;
public ScientificCalculatorForm()
InitializeComponent();
if (isOperatorClicked)
textBox.Text = button.Text;
isOperatorClicked = false;
else
textBox.Text += button.Text;
// Implement the code to evaluate the expression and display the result.
textBox.Text = Math.Sqrt(number).ToString();
isOperatorClicked = true;
textBox.Text = Math.Sin(angle).ToString();
isOperatorClicked = true;
isOperatorClicked = true;
double exponent = 2; // You can modify this based on user input or use another control for entering
the exponent.
isOperatorClicked = true;
if (textBox.Text.Length > 0)
textBox.Clear();
isOperatorClicked = false;
Application.Exit();
textBox.Text += Math.PI.ToString();