Foydalanilgan adabiyotlar ro’yxati:
T.A.Maxarov, M.A.Raximova. – “Dasturlash asoslari (Visual Studio)”. Uslubiy qo’llanma. O’zMU. Toshkent. 2019-y.
R.H. Alayev, H.X. Mamatova “ C# tilida dasturlash”.
A.R.Azamztov –“Algoritmlash va dasturlash asoslari” –Toshkent -2013.
Bjarne Stroustrup. Programming: Principles and Practice Using C++ (2nd Edition). Person Education, Inc. 2014. second printing, January 2015.
Harry Hariom Choudhary, Bjarne M Stroustrup. C++ Programming Professional.: Sixth Best Selling Edition for Beginner's & Expert's 2014.
S.S.Gʻulomov va boshqalar “Axborot tizimlari va texnologiyalari”. Oliy oʻquv yurti talabalari uchun darslik. – T: “Sharq”, 2000 y. 529 b.
A.Abduqodirov, A.Xaitov, R.Shodiyev “Axborot texnologiyalari”. Akademik litsey va kasb-hunar kollejlari uchun darslik. – T: “O’zbekiston”, 2001 y.
E.Gʻaniyev, D.Jomurodov, A.Moʻminov “Zamonaviy kompyuterlarni boshqarish”. Toshkent – “Fan va texnologiya”- 2004 y.
Internet saytlari:
www.ziyonet.uz
.www.edu.uz
.www.tuit.uz
.http://informica.ru/
.www.pedagog.uz/
https://youtu.be/SbB7Tvc-OKc
http://tami.uz
http://www.aim.uz
http://google.com
https://metanit.com/
www.yandex.ru – axborotlar qidirish tizimi
www.ziyonet.uz – ZiyoNet axborot ta’lim portal
Ilova
Kalkulatorning Xaml kodi
Endi biz har bir tugma uchun tugmachani bosish hodisalarini yaratamiz va quyida ko'rsatilgandek tugmalar uchun quyidagi kodni qo'shamiz.
using System;
using System.Windows;
using System.Windows.Controls;
namespace MyCalculatorv1
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void Button_Click_1(object sender, RoutedEventArgs e)
{
Button b = (Button) sender;
tb.Text += b.Content.ToString();
}
private void Result_click(object sender, RoutedEventArgs e)
{
try
{
result();
}
catch (Exception exc)
{
tb.Text = "Error!";
}
}
private void result()
{
String op;
int iOp = 0;
if (tb.Text.Contains("+"))
{
iOp = tb.Text.IndexOf("+");
}
else if (tb.Text.Contains("-"))
{
iOp = tb.Text.IndexOf("-");
}
else if (tb.Text.Contains("*"))
{
iOp = tb.Text.IndexOf("*");
}
else if (tb.Text.Contains("/"))
{
iOp = tb.Text.IndexOf("/");
}
else
{
//error
}
op = tb.Text.Substring(iOp, 1);
double op1 = Convert.ToDouble(tb.Text.Substring(0, iOp));
double op2 = Convert.ToDouble(tb.Text.Substring(iOp + 1, tb.Text.Length - iOp - 1));
if (op == "+")
{
tb.Text += "=" + (op1 + op2);
}
else if (op == "-")
{
tb.Text += "=" + (op1 - op2);
}
else if (op == "*")
{
tb.Text += "=" + (op1 * op2);
}
else
{
tb.Text += "=" + (op1 / op2);
}
}
private void Off_Click_1(object sender, RoutedEventArgs e)
{
Application.Current.Shutdown();
}
private void Del_Click(object sender, RoutedEventArgs e)
{
tb.Text = "";
}
private void R_Click(object sender, RoutedEventArgs e)
{
if (tb.Text.Length > 0)
{
tb.Text = tb.Text.Substring(0, tb.Text.Length - 1);
}
}
}
}
Natija:
Do'stlaringiz bilan baham: |