Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
8 Eseppen birge.docx
Скачиваний:
1
Добавлен:
01.05.2025
Размер:
25.6 Кб
Скачать

7. Using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace ConsoleApplication1

{

class Program

{

static void Main(string[] args)

{

int r =8;

int a = 90;

int b = 45;

int c = 45;

double a1 = Convert.ToDouble(2*r*Math.Sin(a));

Console.WriteLine(a1);

double b1 = Convert.ToDouble(2 * r * Math.Sin(b));

Console.WriteLine(b1);

double c1 = Convert.ToDouble(2 * r * Math.Sin(c));

Console.WriteLine(c1);

Console.ReadKey();

}

}

}

8. Using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

using System.Data.Linq.Mapping;

using System.Data.Linq;

namespace ConsoleApplication1

{

class Program

{

static void Main(string[] args)

{

Northwnd db = new Northwnd(@"c:\linqtest6\northwnd.mdf");

Customer new Cust = new Customer();

newCust.CompanyName = "AdventureWorksCafe";

newCust.CustomerID = "ADVCA";

db.Customers.InsertOnSubmit(newCust);

Console.WriteLine("\nCustomers matching CA before insert");

foreach (var c in db.Customers.Where(cust => cust.CustomerID.Contains("CA")))

{Console.WriteLine("{0}, {1}, {2}",CustomerID, c.CompanyName, c.Orders.Count);}

Console.WriteLine("\nCustomers matching CA after update");

foreach (var c in db.Customers.Where(cust =>cust.CustomerID.Contains("CA")))

{Console.WriteLine("{0}, {1}, {2}”);

db.SubmitChanges();

Console.ReadKey();

}

}

}

9. Using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace ConsoleApplication1

{

class Program

{

static void Main(string[] args)

{

int aj;

int sj;

Console.Write("Algashki joldi engiz:");

aj = Convert.ToInt32(Console.ReadLine());

Console.Write("Songi joldi engiz:");

sj = Convert.ToInt32(Console.ReadLine());

int k = (sj - aj) * 39;

Console.Write(k);

Console.ReadKey();

}

}

}

10. Using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace ConsoleApplication1

{

class Fermer

{

static void Main(string[] args)

{

int numberofcows;

Console.Write("siirlar sani:");

numberofcows = Convert.ToInt32(Console.ReadLine());

Console.Write("jemge ketetin karji:");

int jem = Convert.ToInt32(Console.ReadLine());

Console.Write("ar shopanga 1-siirga tolenetin karji:");

int shop = Convert.ToInt32(Console.ReadLine());

int sum=numberofcows*(shop+jem);

Console.Write("jalpi soma:"+sum);

Console.ReadKey();

}

}

}

11. Using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace ConsoleApplication1

{

class talkaboutyour

{

public string name;

public int r;

public talkaboutyour(string n, int a)

{

name = n;

r = a;

}

public void Show()

{

Console.WriteLine("Имя = " + name + "\tРост = " + r);

}

}

class tallguy

{

static void Main()

{

try

{

talkaboutyour obj = new talkaboutyour("Kazyna", 180);

obj.Show();

}

catch (Exception er)

{

Console.WriteLine(er.Message);

}

Console.Read();

}

}

}

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]