1. Xodimning oylik ish haqiga 45% mukofot puli qo‘shilsin. Hosil bo‘lgan miqdordan 17% daromad solig‘i, 1,5% kasaba uyushmasi va 1% nafaqa solig‘i ushlab qolinsin. Qo‘lga tegadigan pul miqdori chop etilsin


Download 0.74 Mb.
Sana21.06.2023
Hajmi0.74 Mb.
#1642632
Bog'liq
Nafisa


1. Xodimning oylik ish haqiga 45% mukofot puli qo‘shilsin. Hosil bo‘lgan miqdordan 17% daromad solig‘i, 1,5% kasaba uyushmasi va 1% nafaqa solig‘i ushlab qolinsin. Qo‘lga tegadigan pul miqdori chop etilsin.

using System;


public class Program{


public static void Main(){
int oylik = int.Parse(Console.ReadLine());
double ustama=0.45*oylik;
double oylik2=oylik+ustama;
double daromadsoliq=0.17*oylik2;
double kasaba=(oylik2/100)*1.5;
double pensiya=oylik2/100;
double oladigan_oylik=oylik2-(daromadsoliq+kasaba+pensiya);
Console.WriteLine(oladigan_oylik);
Console.ReadKey();
}
}



2.Tekislikdagi nuqta butun sonli koordinatalar bilan berilgan, agar nuqta koordinata o‘qlarida yotmasa 0, agar nuqta (0,0) bilan ustma – ust tushsa 1, agar nuqta OX yoki OY o‘qlarida yotsa, mos ravishda 2 yoki 3 sonlari chop etilsin.
using System;

public class Program{


public static void Main(){
int x = int.Parse(Console.ReadLine());
int y=int.Parse(Console.ReadLine());
if(x==0&&y==0){
Console.WriteLine(1);
}
if(x>0&&y>0||x<0&&y>0||x<0&&y<0||x>0&&y<0){
Console.WriteLine(0);
}
if(x>0&&y==0||x<0&&y==0){
Console.WriteLine(2);
}
if(y>0&&x==0||y<0&&x==0){
Console.WriteLine(3);
}
Console.ReadKey();
}
}



3. Natural n soni va o‘zaro teng bo‘lmagan n ta butun sonlar ketma-ketligi berilgan. Bu ketma - ketlikning eng katta elementidan kichik bo‘lgan sonlarning eng kattasi topilsin.

using System;


public class Program{


public static void Main(){
int n = int.Parse(Console.ReadLine());
int []a=new int [n];
int max=a[0];
for(int i=0; ia[i]=int.Parse(Console.ReadLine());
}
for(int i=1;iif(maxmax=a[i];
//Console.WriteLine(max);
}
}
Array.Sort(a);
for(int i=0; iif(i==1){
Console.WriteLine(a[i]);
}
}
Console.ReadKey();
}
}



4.Uchlari va nuqtalarda bo‘lgan to‘rtbur-chakni yasash mumkinmi? Agar mumkin bo‘lsa uning turi aniqlansin: romb, parallelogram, trapetsia, to‘g‘riburchakli yoki ihtiyoriy to‘rt-burchak.


using System;


using System.Collections.Generic;

class Program {


public static int N = 4;


public static int getDis(KeyValuePair a, KeyValuePair b)
{
return (a.Key - b.Key)*(a.Key - b.Key) +
(a.Value - b.Value)*(a.Value - b.Value);
}
public static bool isPossibleRectangle(int[,] segments)
{
HashSet> st = new HashSet>();
for (int j = 0; j < N; j++)
{
st.Add(new KeyValuePair(segments[j,0], segments[j,1]));
st.Add(new KeyValuePair(segments[j,2], segments[j,3]));
}
if (st.Count != 4)
return false;
HashSet dist = new HashSet();
foreach(var it1 in st){
foreach(var it2 in st){
if(it1.Key != it2.Key && it1.Value != it2.Value){
dist.Add(getDis(it1, it2));
}
}
}
if (dist.Count > 3)
return false;
int[] distance = new int[3];
int i = 0;
foreach(var it in dist){
distance[i] = it;
i = i + 1;
}
if (dist.Count == 2)
return (2*distance[0] == distance[1]);
return (distance[0] + distance[1] == distance[2]);
}
public static void Main()
{

int[,] segments = {


{4, 2, 7, 5},
{2, 4, 4, 2},
{2, 4, 5, 7},
{5, 7, 7, 5}
};

if(isPossibleRectangle(segments) == true){


Console.WriteLine("Yes");
}
else{
Console.WriteLine("No");
}
}
}



5.Talabalar guruhini tavsivlovchi TALABA_GURUHI sinfi yaratilsin. Unda ixtiyoriy sondagi talalbalar bilan ishlash, qandaydir alomati boyocha talabani izlash (familiya, tug‘ilgan yili yoki telefon nomeri bo‘yicha), yangi yozuvni qo‘shish, o‘chirish va tartiblash imkoniyatlari bo‘lsin.


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication4


{
class TAlABA_GURUHI
{
public string name { get; set; }
public string fam { get; set; }
public string guruh { get; set; }
public string phone { get; set; }
}
}
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApplication4


{
class Program
{
static void Main(string[] args)
{
List students = new List{
new TAlABA_GURUHI{name="Jasur",fam="Sobirov",guruh="202-KIDT",phone="+998952319076"},
new TAlABA_GURUHI{name="Madina",fam="Qo`chqorova",guruh="202-KIDT",phone="+998972349076"},
new TAlABA_GURUHI{name="Rustam",fam="Nosirov",guruh="191-Fizika",phone="+998943891892"},
new TAlABA_GURUHI{name="Asadbek",fam="Kuranbayev",guruh="194-Fizika",phone="+998943876492"}
};
foreach (var i in students)
{
Console.WriteLine(i.name + " " + i.fam + " " + i.guruh + " " + i.phone);
}
string st = Console.ReadLine();
var q = from x in students
where x.guruh.Equals(st)
select x.name + " " + x.fam + " " + x.guruh + " " + x.phone;
int y = 0;
foreach (var i in q)
{
Console.WriteLine(i);
y++;
}
Console.WriteLine(y + " ta talaba topildi");
}
}
}

Download 0.74 Mb.

Do'stlaringiz bilan baham:




Ma'lumotlar bazasi mualliflik huquqi bilan himoyalangan ©fayllar.org 2024
ma'muriyatiga murojaat qiling