Variant №1 1-masala
Download 221.02 Kb.
|
Mustaqil ish 3
Fan: Algoritmik tillar va dastulash Guruh 21.06 2022-2023-o’quv yili Variant № 1 1-masala. Guruh nomli (ID, Nomi, YunalishNomi, maydonlarga ega) class yarating. 5 ta guruhdan iborat ro’yxat tuzing. Ro’yxatni chiqaruvchi dastur tuzing. Masalaning C# dagi matni: Title="M_ish_3" Height="300" Width="300" x:Name="Form" Loaded="Form_Loaded"> Grid.Column="0" Grid.Row="0" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="5,5,5,5" x:Name="jadval" Loaded="jadval_Loaded"/> using System; using System.Collections.Generic; using System.Text; using System.Windows;``` using System.Windows.Controls; using System.Windows.Data; using System.Windows.Documents; using System.Windows.Input; using System.Windows.Media; using System.Linq; namespace M_ish_3 { public class Guruh { public int ID; public string Nomi; public string YunalishNomi; }
{ public Window1() { InitializeComponent(); a=new List } List void Form_Loaded(object sender, RoutedEventArgs e) { a.Add(new Guruh{ID=1,Nomi="21.06",YunalishNomi="Amaliy matematika"}); a.Add(new Guruh{ID=2,Nomi="21.05",YunalishNomi="Matematika"}); a.Add(new Guruh{ID=3,Nomi="21.10",YunalishNomi="Fizika"}); a.Add(new Guruh{ID=4,Nomi="21.15",YunalishNomi="Psixologiya"}); a.Add(new Guruh{ID=5,Nomi="21.102",YunalishNomi="Xorijiy til"}); } void jadval_Loaded(object sender, RoutedEventArgs e) { var s= from n in a select new { ID=n.ID, Nomi=n.Nomi, YunalishNomi=n.YunalishNomi }; jadval.ItemsSource=s; } } } Natija: 2-masala. Talaba nomli (ID, FIO, Manzil, Yoshi,GuruhID maydonlarga ega) class yarating. 10 ta talabadan iborat ro’yhat tuzing. 16 yoshdan katta talabalarni Linq so’rovi yordamida chiqaruvchi dastur tuzing. Masalaning C# dagi matni: Title="M_ish_3" x:Name="Form" Loaded="Form_Loaded" Width="481" Height="306"> Grid.Column="0" Grid.Row="0" HorizontalAlignment="Stretch" VerticalAlignment="Top" Margin="5,5,5,5" x:Name="jadval" Loaded="jadval_Loaded" /> Download 221.02 Kb. Do'stlaringiz bilan baham: |
Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling
ma'muriyatiga murojaat qiling