Skip to content

Commit

Permalink
Hometask full done
Browse files Browse the repository at this point in the history
  • Loading branch information
Abdurahmon0412 committed Aug 12, 2023
1 parent 0378c6e commit c9af020
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 5 deletions.
10 changes: 10 additions & 0 deletions Homeworks.sln
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "N23_HT1", "N23_HT1", "{CD3D
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "N23_HT1", "N23_HT1\N23_HT1.csproj", "{F36BCA84-3D44-4FE4-9F17-364841C17BD2}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "N23_HT2", "N23_HT2", "{BC687718-A58E-4FE8-843D-A519D0CBE24B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "N23_HT2", "N23_HT2\N23_HT2.csproj", "{436DDA7F-BCFF-4A0A-8C40-AFF08569297B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -351,6 +355,10 @@ Global
{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
{436DDA7F-BCFF-4A0A-8C40-AFF08569297B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{436DDA7F-BCFF-4A0A-8C40-AFF08569297B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{436DDA7F-BCFF-4A0A-8C40-AFF08569297B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{436DDA7F-BCFF-4A0A-8C40-AFF08569297B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down Expand Up @@ -422,6 +430,8 @@ Global
{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}
{BC687718-A58E-4FE8-843D-A519D0CBE24B} = {ADD83ED5-61AE-4725-8B65-2327B01FF147}
{436DDA7F-BCFF-4A0A-8C40-AFF08569297B} = {BC687718-A58E-4FE8-843D-A519D0CBE24B}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {8B77269B-B20D-4860-9637-2E2771096EE6}
Expand Down
2 changes: 1 addition & 1 deletion N22_2_Hometask/Model/CrashReport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

namespace N22_2_Hometask.Model
{
internal class CrashReport:IRewiev
public class CrashReport:IRewiev
{
public Guid Id { get; set; }
public int Star { get; set; }
Expand Down
4 changes: 2 additions & 2 deletions N23_HT1/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
};

products.OrderByDescending(product => product.Stars)
.ThenByDescending(produc => produc.Inventore).Take(5)
.ToList().ForEach(product => Console.WriteLine($"{product.Name} - {product.Inventore} in stock"));
.ThenByDescending(produc => produc.Inventore).Take(5).ToList()
.ForEach(product => Console.WriteLine($"{product.Name} - {product.Inventore} in stock"));
29 changes: 27 additions & 2 deletions N23_HT2/Program.cs
Original file line number Diff line number Diff line change
@@ -1,2 +1,27 @@
// See https://aka.ms/new-console-template for more information
Console.WriteLine("Hello, World!");
using N23_HT2;


var Users = new List<User>
{
new User("John", "Doe", "[email protected]"),
new User("Jane", "Doe", "[email protected]"),
new User("Bob", "Smith", "[email protected]"),
new User("Alice", "Johnson", "[email protected]"),
new User("Mike", "Brown", "[email protected]"),
new User("Emily", "Davis", "[email protected]"),
new User("David", "Wilson", "[email protected]"),
new User("Sarah", "Taylor", "[email protected]"),
new User("Tom", "Anderson", "[email protected]"),
new User("Lisa", "Thomas", "[email protected]")
};

Console.WriteLine("Enter the keyword");
var keyvord = Console.ReadLine();

Users.Where(user => user.FirstName.Contains(keyvord, StringComparison.OrdinalIgnoreCase)
|| user.LastName.Contains(keyvord, StringComparison.OrdinalIgnoreCase)
|| user.EmailAddress.Contains(keyvord, StringComparison.OrdinalIgnoreCase)).ToList()
.ForEach(user =>
Console.WriteLine($"{user.FirstName.PadRight(15)} {user.LastName.PadRight(15)} - {user.EmailAddress}"));


23 changes: 23 additions & 0 deletions N23_HT2/User.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_HT2
{
public class User
{
public string FirstName { get; set; }
public string LastName { get; set; }
public string EmailAddress { get; set; }

public User(string firstname, string lastname, string email)
{
FirstName = firstname;
LastName = lastname;
EmailAddress = email;
}

}
}

0 comments on commit c9af020

Please sign in to comment.