It can help you more be aware of whats going on and what you need to do.
Answer:
static int checkSymbol(char ch)
{
switch (ch)
{
case '+':
case '-':
return 1;
case '*':
case '/':
return 2;
case '^':
return 3;
}
return -1;
}
static String convertInfixToPostfix(String expression)
{
String calculation = new String("");
Stack<Character> operands = new Stack<>();
Stack<Character> operators = new Stack<>();
for (int i = 0; i<expression.length(); ++i)
{
char c = expression.charAt(i);
if (Character.isLetterOrDigit(c))
operands.push(c);
else if (c == '(')
operators.push(c);
else if (c == ')')
{
while (!operators.isEmpty() && operators.peek() != '(')
operands.push(operators.pop());
if (!operators.isEmpty() && operators.peek() != '(')
return NULL;
else
operators.pop();
}
else
{
while (!operators.isEmpty() && checkSymbol(c) <= checkSymbol(operators.peek()))
operands.push(operators.pop());
operators.push(c);
}
}
while (!operators.isEmpty())
operands.push(operators.pop());
while (!operands.isEmpty())
calculation+=operands.pop();
calculation=calculation.reverse();
return calculation;
}
Explanation:
- Create the checkSymbol function to see what symbol is being passed to the stack.
- Create the convertInfixToPostfix function that keeps track of the operands and the operators stack.
- Use conditional statements to check whether the character being passed is a letter, digit, symbol or a bracket.
- While the operators is not empty, keep pushing the character to the operators stack.
- At last reverse and return the calculation which has all the results.
Which is a multicast address ?
ans: 241.2.2.1
Answer:
SUM, AVERAGE, MAX,MIN
Explanation:
Sum: The SUM function is categorized under Excel Math and Trigonometry functions. ... The function will sum up cells that are supplied as multiple arguments. It is the most popular and widely used function in Excel. SUM helps users perform a quick summation of specified cells in MS Excel.
Average: The AVERAGE function in Excel does exactly what you think it should. It computes the mathematical average of a set of numbers. In other words, it adds up a set of numbers and then divides the sum by how many numbers are being averaged.
Max: he MAX function will count numbers but ignore empty cells, text, the logical values TRUE and FALSE, and text values. In financial analysis, MAX can be useful in calculating the highest score, the fastest time, the highest expense or revenue amount, etc.
Min: will return the minimum value in a given list of arguments. From a given set of numeric values, it will return the smallest value. Unlike the MINA function, the MIN function ignores numbers, text, and logical values TRUE and FALSE and text values. In financial modeling.
No it doesn’t count as an instrument