Uchun Item5 va Item6 xususiyatlaridan foydalaning
Download 16.22 Kb.
|
Ruxsora
O`zMu Jizzax filiali "Amaliy matimakita" fakulteti "Kampyuter ilmlari va dasturlash texnalogiyalari" yo`nalishi 472-22 guruh Xudoyshukurva Ruxsora Algaretmik tillar va dasturlash fanidan 1-modul topshirig`i 25-Variant 25. 23-mashqda yaratilgan kortejning beshinchi va oltinchi elementlariga murojaat uchun Item5 va Item6 xususiyatlaridan foydalaning. using System; public class KortejLar
Console.Write("Harakat qadamini kiriting: "); int step = int.Parse(Console.ReadLine()); // doiraning markaz koordinatalarini aniqlash int centerX = 0; int centerY = 0; // harakat boshlang'ich x va y koordinatalari int x = centerX + radius; int y = centerY; // doirani aylantirish uchun bitta sizish int direction = 0; for (int i = 0; i < 360 / step * radius; i++) { // harakat to'g'risidagi koordinatalarni chop etish Console.WriteLine("({0}, {1})", x, y); // yangi koordinatalarni hisoblash switch (direction) { case 0: y++; if (y == centerY + radius) direction = 1; break; case 1: x--; if (x == centerX - radius) direction = 2; break; case 2: y--; if (y == centerY - radius) direction = 3; break; case 3: x++; if (x == centerX + radius) direction = 0; break; } } Console.ReadLine(); } } 25. Ism, Familiya va Email qator maydonlari bilan Mijoz nomli tuzilma yarating. using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApp4 { struct Mijozlar { public string ism; public string familiya; public string email; public void print () { Console.WriteLine($"Ismi : {ism}, Familiyasi : {familiya}, E-poschtasi : {email}"); } } internal class Program { static void Main(string[] args) { Mijozlar mijoz_1 = new Mijozlar(); mijoz_1.ism = "ruxsora"; mijoz_1.familiya = "xudoyshukurva"; mijoz_1.email = " ruxsora _ xudoyshukurva @mail.uz"; mijoz_1.print(); } } } Download 16.22 Kb. Do'stlaringiz bilan baham: |
ma'muriyatiga murojaat qiling