I want to show Components in a tabs , so first of all create few components. In this project we have three components, First View Component public class AllViewComponent : ViewComponent { private readonly UserManager<ApplicationUser> _userManager; public AllViewComponent(UserManager<ApplicationUser> userManager) { _userManager = userManager; } public async Task<IViewComponentResult> InvokeAsync() { List<StudentViewModel> allUsers = new List<StudentViewModel>(); var items = await _userManager.Users.ToListAsync(); foreach (var item in items) { allUsers.Add(new StudentViewModel {Id=item.Id, EnrollmentNo = item.EnrollmentNo, FatherName = item.FatherName, Name = item.Name, Age = item.Age, Birthdate = item.Birthdate, Address = item.Address, Gender = item.Gender, Email = item.Email }); }
Problem: Design an algorithm to find minimum of two distinct numbers and using the same, find minimum of three distinct numbers.
Input : For sub-algorithm 2 numbers and for main algorithm 3 numbers.
Output: Minimum number
MIN_OF_2(NUM1, NUM2) [Sub-Algorithm]
[NUM1 and NUM2 are two numbers]
If NUM1<NUM2 Then:
Return NUM1
Else:
Return NUM2
[End of If]
Exit
MIN_OF_3(NUM1,NUM2,NUM3) [Main Algorithm]
[NUM1, NUM2, and NUM3 are distinct numbers]
Returns MIN_OF_2(MIN_OF_2(NUM1, NUM2), NUM3)
Exit
Input : For sub-algorithm 2 numbers and for main algorithm 3 numbers.
Output: Minimum number
MIN_OF_2(NUM1, NUM2) [Sub-Algorithm]
[NUM1 and NUM2 are two numbers]
If NUM1<NUM2 Then:
Return NUM1
Else:
Return NUM2
[End of If]
Exit
MIN_OF_3(NUM1,NUM2,NUM3) [Main Algorithm]
[NUM1, NUM2, and NUM3 are distinct numbers]
Returns MIN_OF_2(MIN_OF_2(NUM1, NUM2), NUM3)
Exit
Comments
Post a Comment