Skip to content

Commit

Permalink
Hometask 23 1 iS mark done
Browse files Browse the repository at this point in the history
  • Loading branch information
Abdurahmon0412 committed Aug 12, 2023
1 parent 13fdab3 commit 0378c6e
Show file tree
Hide file tree
Showing 8 changed files with 118 additions and 1 deletion.
21 changes: 20 additions & 1 deletion Homeworks.sln
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,15 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "N22_WriteLlist", "N22_Write
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "N22_2", "N22_2", "{966F0F80-9E8D-4F24-8B88-F053AA0627C6}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "N22_2_Hometask", "N22_2_Hometask\N22_2_Hometask.csproj", "{1D1007B9-DDE2-4645-B89F-342A2F4E0BB7}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "N22_2_Hometask", "N22_2_Hometask\N22_2_Hometask.csproj", "{1D1007B9-DDE2-4645-B89F-342A2F4E0BB7}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "N22_IsPrime", "N22_IsPrime\N22_IsPrime.csproj", "{C7EE928E-3B00-4B44-8A92-D083B8C8CD88}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "N23", "N23", "{ADD83ED5-61AE-4725-8B65-2327B01FF147}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "N23_HT1", "N23_HT1", "{CD3DA6AB-7CBA-4BC7-8786-546A6D25D77F}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "N23_HT1", "N23_HT1\N23_HT1.csproj", "{F36BCA84-3D44-4FE4-9F17-364841C17BD2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down Expand Up @@ -335,6 +343,14 @@ Global
{1D1007B9-DDE2-4645-B89F-342A2F4E0BB7}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1D1007B9-DDE2-4645-B89F-342A2F4E0BB7}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1D1007B9-DDE2-4645-B89F-342A2F4E0BB7}.Release|Any CPU.Build.0 = Release|Any CPU
{C7EE928E-3B00-4B44-8A92-D083B8C8CD88}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C7EE928E-3B00-4B44-8A92-D083B8C8CD88}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C7EE928E-3B00-4B44-8A92-D083B8C8CD88}.Release|Any CPU.ActiveCfg = Release|Any CPU
{C7EE928E-3B00-4B44-8A92-D083B8C8CD88}.Release|Any CPU.Build.0 = Release|Any CPU
{F36BCA84-3D44-4FE4-9F17-364841C17BD2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{F36BCA84-3D44-4FE4-9F17-364841C17BD2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{F36BCA84-3D44-4FE4-9F17-364841C17BD2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{F36BCA84-3D44-4FE4-9F17-364841C17BD2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -403,6 +419,9 @@ Global
{CD7B1616-9B70-4FC8-BB1A-3B41E766E078} = {0F11A119-2C25-46CF-AC3F-C66073C85C86}
{22FF572D-A745-41FB-B4BD-48CFF604ADA0} = {40FDA0A2-3C89-426C-B3C5-37838F4864CE}
{1D1007B9-DDE2-4645-B89F-342A2F4E0BB7} = {966F0F80-9E8D-4F24-8B88-F053AA0627C6}
{C7EE928E-3B00-4B44-8A92-D083B8C8CD88} = {966F0F80-9E8D-4F24-8B88-F053AA0627C6}
{CD3DA6AB-7CBA-4BC7-8786-546A6D25D77F} = {ADD83ED5-61AE-4725-8B65-2327B01FF147}
{F36BCA84-3D44-4FE4-9F17-364841C17BD2} = {CD3DA6AB-7CBA-4BC7-8786-546A6D25D77F}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8B77269B-B20D-4860-9637-2E2771096EE6}
Expand Down
10 changes: 10 additions & 0 deletions N22_IsPrime/N22_IsPrime.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
22 changes: 22 additions & 0 deletions N22_IsPrime/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
bool IsPrime(int prime)
{
for (int i = 2; i < Math.Sqrt(prime) + 1; i++)
{
if (prime % i == 0)
{
return false;
}
}
return true;
}

List<int> Numbers = new List<int>
{
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18,
52,45,47,79,53,23,25,49
};

Numbers.Where(number => IsPrime(number) == true).OrderByDescending(a => a).ToList().ForEach(Console.WriteLine);
//Numbers.Where(number => IsPrime(number) == true).ToList().ForEach(Console.WriteLine);


10 changes: 10 additions & 0 deletions N23_HT1/N23_HT1.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
23 changes: 23 additions & 0 deletions N23_HT1/Product.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace N23_HT1
{
public class Product
{
public string Name { get; set; }
public int Stars { get; set; }
public int Inventore { get; set; }

public Product(string name,int stars, int inventory)
{
Name = name;
Stars = stars;
Inventore = inventory;
}

}
}
21 changes: 21 additions & 0 deletions N23_HT1/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
using N23_HT1;



var products = new List<Product>
{
new Product("iPhone 12", 4, 60),
new Product("Samsung Galaxy S21", 4, 75),
new Product("Google Pixel 5", 4, 50),
new Product("OnePlus 9 Pro", 4, 60),
new Product("Xiaomi Mi 11", 4, 80),
new Product("Sony Xperia 1 III", 3, 40),
new Product("LG Wing", 3, 30),
new Product("Motorola Edge+", 3, 35),
new Product("Iphone 14", 5, 10),
new Product("Asus ROG Phone 5", 4, 70)
};

products.OrderByDescending(product => product.Stars)
.ThenByDescending(produc => produc.Inventore).Take(5)
.ToList().ForEach(product => Console.WriteLine($"{product.Name} - {product.Inventore} in stock"));
10 changes: 10 additions & 0 deletions N23_HT2/N23_HT2.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net7.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

</Project>
2 changes: 2 additions & 0 deletions N23_HT2/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");

0 comments on commit 0378c6e

Please sign in to comment.