Xato darajasi. 0 (xato yo'q) dan 1gacha bo'lgan haqiqiy raqam (token noto'g'ri), bu belgining namunaga qanchalik yaxshi mos kelishini anglatadi.
Token foydalanish belgisi. Chiqindilarni yig'ish bilan chiziqni tahlil qilganda, belgilarning bir qismi tashlanadi, ular uchun bu belgi qo'yilmaydi. Bunday holda, xatoning yakuniy qiymati ishlatilgan belgilarning xatolaridan arifmetik o'rtacha hisoblanadi.
2.4. Ishlab chiqarilgan dasturni C# dasturlash tilidagi kodi va uning taxlili.
/*
* Created by SharpDevelop.
* User: Avtech
* Date: 02.12.2021
* Time: 16:20
*
* To change this template use Tools | Options | Coding | Edit Standard Headers.
*/
using System;
using System.Drawing;
using System.Windows.Forms;
namespace loyihakurs
{
///
/// Description of KrillLotin.
///
public partial class KrillLotin : Form
{
string[] krill = {"ю","Ю","я","Я","ё","Ё","ш","Ш","ч","Ч","ў","Ў",
"қ","Қ","ғ","Ғ","ц","Ц","й","Й","у","У","к","К",
"е","Е","н","Н","г","Г","щ","Щ","з","З","х","Х",
"э","Э","ж","Ж","д","Д","л","Л","о","О","р","Р",
"п","П","а","А","в","В","ф","Ф","с","С","м","М",
"и","И","т","Т","б","Б","қ","Қ","ҳ","Ҳ","ғ","Ғ","ь","ы"};
string[] lotin={"yu","Yu","ya","Ya","yo","Yo","sh","Sh","ch","Ch","o'","O'",
"q","Q","g'","G'","ts","Ts","y","Y","u","U","k","K","e","E",
"n","N","g","G","sh","Sh","z","Z","x","X","e","E","j","J",
"d","D","l","L","o","O","r","R","p","P","a","A","v","V","f",
"F","s","S","m","M","i","I","t","T","b","B","q","Q","h","H",
"g'","G'","`",""};
public KrillLotin()
{
InitializeComponent();
this.WindowState = FormWindowState.Maximized;
}
private void lotin1()
{
string str = richTextBox1.Text;
for(int i=0 ; i< lotin.Length; i++)
{
str = str.Replace(krill[i],lotin[i]);
}
richTextBox2.Text=str;
}
private void tozalash()
{
richTextBox2.Text = "";
richTextBox1.Text = "";
}
void Button1Click(object sender, EventArgs e)
{
lotin1();
}
private void KrillLotin_SizeChanged(object sender, EventArgs e)
{
panel2.Width = (int)(this.Width * 0.5);
}
private void richTextBox1_SizeChanged(object sender, EventArgs e)
{
}
private void richTextBox2_TextChanged(object sender, EventArgs e)
{
}
private void richTextBox1_TextChanged(object sender, EventArgs e)
{
}
private void button2_Click(object sender, EventArgs e)
{
tozalash();
}
private void button3_Click(object sender, EventArgs e)
{
if (richTextBox2.Text == "")
{
MessageBox.Show("Matn yo'qku!!!");
}
else
{
Clipboard.SetText(richTextBox2.Text);
}
}
private void KrillLotin_Load(object sender, EventArgs e)
{
}
}
}
Matn forma orqli yuklab olinadi va for sikli yordamid birma-bir lotin (yoki kiril) alifbosiga aylantiriladi. Ozgartirilgan satr Yana maydon yordamida ekrangachiqariladi.
Tozalash funksiya maydonni tozalaydi
Dostları ilə paylaş: |