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.
The Digital Revolution refers to the advancement of technology from analog electronic and mechanical devices to the digital technology available today. The era started to during the 1980s and is ongoing. ... The Digital Revolution is sometimes also called the Third Industrial Revolution.
Answer:
False
Explanation:
Plug and play devices are computer peripheral devices that can be used immediately, with little or no necessary configuration when plugged or connected to the computer system.
Printers are mostly electronic devices used as an output of a hard copy of a computer system application document. They are not part of the computer system (peripheral devices). They come with installation disk which a computer must install, in order to be able to use the printer.
Yes they are peripheral devices, but they are not plug and play devices since its software must be installed on the computer, to use it
Answer:
File, Edit, and View
Explanation:
These are the standard ones that come with the software.