Muhammad Bilal (01-133142-074) : Using Using Using Using Using Using Using Using Namespace Public Partial Class Public
Muhammad Bilal (01-133142-074) : Using Using Using Using Using Using Using Using Namespace Public Partial Class Public
using
using
using
using
using
using
using
using
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Linq;
System.Text;
System.Windows.Forms;
namespace Calculator
textBox1.Text += "5";
textBox1.Text += "6";
textBox1.Text += "7";
textBox1.Text += "8";
textBox1.Text += "9";
textBox1.Text += "0";
textBox1.Text += "+";
textBox1.Text += "-";
textBox1.Text += "*";
textBox1.Text += "/";
}
}
}
else if (textBox1.Text.Contains('*'))
{
var nums = textBox1.Text.Split('*');
textBox1.Text += System.Environment.NewLine + System.Environment.NewLine +
(Convert.ToInt32(nums[0]) * Convert.ToInt32(nums[1]));
}
else if (textBox1.Text.Contains('/'))
{
var nums = textBox1.Text.Split('/');
textBox1.Text += System.Environment.NewLine + System.Environment.NewLine +
(Convert.ToInt32(nums[0])
/ Convert.ToInt32(nums[1]));
}
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Text;
namespace Calculator
{
public class calculator
{
public static string add(string s)
{
if (s == "enter number")
{
s = "";
}
}
}
}
using
using
using
using
using
using
using
using
System;
System.Collections.Generic;
System.ComponentModel;
System.Data;
System.Drawing;
System.Linq;
System.Text;
System.Windows.Forms;
namespace Calculator
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
textBox1.Text = "Enter Numbers";
}
private void button1_Click(object sender, EventArgs e)
{
if (textBox1.Text == "Enter Numbers")
{
textBox1.Text = "";
}
}
textBox1.Text += "1";
textBox1.Text += "2";
textBox1.Text = "";
textBox1.Text += "3";
}
private void button4_Click(object sender, EventArgs e)
{
if (textBox1.Text == "Enter Numbers")
{
textBox1.Text = "";
}
textBox1.Text += "4";
}
private void button5_Click(object sender, EventArgs e)
{
if (textBox1.Text == "Enter Numbers")
{
textBox1.Text = "";
}
textBox1.Text += "5";
}
private void button6_Click(object sender, EventArgs e)
{
if (textBox1.Text == "Enter Numbers")
{
textBox1.Text = "";
}
textBox1.Text += "6";
}
private void button7_Click(object sender, EventArgs e)
{
if (textBox1.Text == "Enter Numbers")
{
textBox1.Text = "";
}
textBox1.Text += "7";
}
private void button8_Click(object sender, EventArgs e)
{
if (textBox1.Text == "Enter Numbers")
{
textBox1.Text = "";
}
textBox1.Text += "8";
}
private void button9_Click(object sender, EventArgs e)
{
using
using
using
using
System;
System.Collections.Generic;
System.Linq;
System.Text;
namespace Calculator
{
public class calculator
{
public static string add(string s)
{
if (s == "enter number")
{
s = "";
}
s += "+";
return s;
}
}
}