3-misol. Muntazam uchburchak tomonlari berilgan, shu uchburchakning yuzini hisoblashda 2-darajali ildiz ostidagi 3 ni 1.7 deb olib hisoblaganimizda absolyut va nisbiy xatoliklarni toping.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication14
{
class Program
{
static void Main(string[] args)
{
Console.Write("Muntazam uchburchak tomonini kiriting:");
double a = double.Parse(Console.ReadLine());
double S = Math.Pow(3, 0.5) * a * a / 4;
double S1 = 1.7 * a * a / 4;
double d=Math.Abs(S-S1), q=d/S;
Console.WriteLine("Absolyut xato:{0}", d);
Console.WriteLine("Nisbiy xato:{0}",q );
Console.ReadKey(true);
}
}
}
4-misol. Doiraning radiusi berilgan bo`lib, uning yuzini hisoblashda π sonini 3.14 deb olganimida yuzaga keladigan absolyut va nisbiy xatoliklar.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication14
{
class Program
{
static void Main(string[] args)
{
Console.Write("Doira radiusini kiriting:");
double a = double.Parse(Console.ReadLine());
double S = Math.PI*a*a;
double S1 =3.14*a*a;
double d=Math.Abs(S-S1), q=d/S;
Console.WriteLine("Absolyut xato:{0}", d);
Console.WriteLine("Nisbiy xato:{0}",q );
Console.ReadKey(true);
}
}
}
5-misol. A4 fomatdagi qog‘ozning uzunligi (29,7 0,1) sm. Xorazmdan Tosh- kentgacha bo‘lgan masofa (1100 1) km. Birinchi holda absolyut xatolik 1 mm dan, ikkinchi holda esa 1 km dan oshmaydi. Bu o‘lchashlarning aniqligini taqqoslang.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication14
{
class Program
{
static void Main(string[] args)
{
Console.Write("Qog`oz uzunligini kiriting:");
double a = double.Parse(Console.ReadLine());
Console.Write("Absolyut xatoligini kiriting:");
double a1 = double.Parse(Console.ReadLine());
Console.Write("Yo`l uzunligini kiriting:");
double b = double.Parse(Console.ReadLine());
Console.Write("Absolyut xatoligini kiriting:");
double b1 = double.Parse(Console.ReadLine());
double A = a1 / a * 100;
double B = b1 / b * 100;
Console.WriteLine("Qog`oz uzunligini nisbiy xatoligi:{0}", A);
Console.WriteLine("Yo`l uzunligini nisbiy xatoligi:{0}", B);
if (A > B)
Console.WriteLine("Yo`lni o`lchash aniqroq.");
else
Console.WriteLine("Qog`ozni o`lchash aniqroq.");
Console.ReadKey(true);
}
}
}
6-misol. Silindrik porshen 35 mm atrofidagi diametrga ega. Mikrometr yordamida o‘lchashning chegaraviy nisbiy xatoligi 0,05% bo‘lishi uchun uni qanday aniqlikda o‘lchash lozim?
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication14
{
class Program
{
static void Main(string[] args)
{
Console.Write("Porshen diametrini kiriting:");
double a = double.Parse(Console.ReadLine());
Console.Write("Mikrometrning Nisbiy xatoligini kiriting:");
double a1 = double.Parse(Console.ReadLine());
double S = a * a1 / 100;
Console.WriteLine("Demak, mikrometrda o`lschash aniqligi {0}+{1}",a,S);
Console.ReadKey(true);
}
}
}
Do'stlaringiz bilan baham: |