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 }); }
Evaluation of POSTFIX expression using STACK :
To evaluation the value of a POSTFIX expression STACK can be used in the following way:
Procedure: Add #, a pound symbol, a sentinel, a terminating symbol at the end of the POSTFIX expression. Scan the expression from left to right till #.If the character scanned character is an operand PUSH it on to STACK. If the scanned character is any operator, * , POP STACK once call it B and POP again and call it A, find A * B, and PUSH the result on to STACK. If the character scanned is #, then POP the STACK and it is the value of the POSTFIX expression.. For example consider a POSTFIX expression, 6 3 2| *3 6 +/.
The value of POSTFIX expression is 6.
Algorithm to evaluate the value of POSTFIX expression:
POSTFIXVAL (P)
[P is a POSTFIX expression]
Add # at the end of P
Repeat Scanning P from left to right While scanned character
< > #
If Scanned Character = operand Then:
[PUSH it on to STACK]
STACK [TOP]<--OPERAND, TOP<--TOP+1
Else:
B<--STACK[TOP], TOP<--TOP-1
A<--STACK[TOP],TOP<--TOP-1
RES <-- A operator B
STACK [TOP]<--RES
[End of While]
VAL<--STACK[TOP]
Write : ‘Value of POSTFIX expression is ‘, VAL
Exit.
To evaluation the value of a POSTFIX expression STACK can be used in the following way:
Procedure: Add #, a pound symbol, a sentinel, a terminating symbol at the end of the POSTFIX expression. Scan the expression from left to right till #.If the character scanned character is an operand PUSH it on to STACK. If the scanned character is any operator, * , POP STACK once call it B and POP again and call it A, find A * B, and PUSH the result on to STACK. If the character scanned is #, then POP the STACK and it is the value of the POSTFIX expression.. For example consider a POSTFIX expression, 6 3 2| *3 6 +/.
The value of POSTFIX expression is 6.
Algorithm to evaluate the value of POSTFIX expression:
POSTFIXVAL (P)
[P is a POSTFIX expression]
Add # at the end of P
Repeat Scanning P from left to right While scanned character
< > #
If Scanned Character = operand Then:
[PUSH it on to STACK]
STACK [TOP]<--OPERAND, TOP<--TOP+1
Else:
B<--STACK[TOP], TOP<--TOP-1
A<--STACK[TOP],TOP<--TOP-1
RES <-- A operator B
STACK [TOP]<--RES
[End of While]
VAL<--STACK[TOP]
Write : ‘Value of POSTFIX expression is ‘, VAL
Exit.
Comments
Post a Comment