1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
prisoha [69]
3 years ago
10

Java !!!

Computers and Technology
1 answer:
coldgirl [10]3 years ago
7 0

Answer:

Explanation:

import java.util.*;

public class BalancedBrackets {

// function to check if brackets are balanced

static boolean isBalanced(String expr)

{

Stack<Character> stack = new Stack<Character>();

for (int i = 0; i < expr.length(); i++)

{

char x = expr.charAt(i);

if (x == '(' || x == '[' || x == '{')

{

// Push the element in the stack

stack.push(x);

continue;

}

if (stack.isEmpty())

return false;

char check;

switch (x) {

case ')':

check = stack.pop();

if (check == '{' || check == '[')

return false;

break;

case '}':

check = stack.pop();

if (check == '(' || check == '[')

return false;

break;

case ']':

check = stack.pop();

if (check == '(' || check == '{')

return false;

break;

}

}

// Check Empty Stack

return (stack.isEmpty());

}

public static void main(String[] args)

{

Scanner scan = new Scanner(System.in);

System.out.println("\nEnter the expression to check is balanced or not !");

String expr = scan.nextLine();

boolean output;

output = isBalanced(expr);

System.out.println(output);

if (output)

System.out.println("Balanced ");

else

System.out.println("Not Balanced ");

scan.close();

}

}

You might be interested in
In some cases, certain Hyper-V guest operating system features do not function properly using the operating system's own device
klasskru [66]

Answer:

The correct answer to the following question will be "Guest Integration Service".

Explanation:

Integration resources are often a packaged package of applications that enhances connectivity between the hosting network as well as the virtual device when enabled throughout the VM.

  • This also seamlessly integrates time between both the visitors and server OS and could provide a pulse and folder compatibility.
  • It offers a Hyper-V network interface for unidirectional copying of data from and to another virtual machine.

This package of tools will help to fix compatibility problems. So, that is the right answer.

8 0
3 years ago
6. According to camp policy, staff members need to be at least 23 years old to transport students. Dean now wants to determine h
Kamila [148]

Answer:

This seems to be related to MS Excel, here we will discuss the related formula:

<u>=IF(VLOOKUP("Adam Moriarty",$B$3:$C$5,2)>23,"Yes","No")</u>

the name can also be written in adjacent to J2 cell i.e. I2 and its reference to be used in vlookup primary key as follows:

<u>=IF(VLOOKUP(I2,$B$3:$C$5,2)>23,"Yes","No")</u>

Explanation:

We have used simple IF function combined with VLOOKUP function to reference this formula to the table of names and ages of the members (here the table is $B$3:$C$5 and ages are mentioned in 2nd column of the table)

please find attached screenshot for clarification

6 0
3 years ago
Write a program in java to enter a character.The program displays the message "uppercase vowel" if entered character is uppercas
horrorfan [7]

Answer:

d

Explanation:

i think

3 0
3 years ago
Which of the following describes the purpose of project management? planning and organizing resources to meet a goal arranging t
True [87]

Answer:

The answer to this question is given below in the explanation section.

Explanation:

The question is about selecting the option among given options that best describes the purpose of project management.

The correct option of this question is the purpose of project management is planning and organizing resources to meet a goal.

Because project management is all about planning and organizing resources of a project to meet project goals.

Other options are not correct,

because arranging the order of tasks in a project, presenting data in an organized manner, and producing a quality project- all come under project management- are parts of planning and organizing steps of project management.

4 0
2 years ago
Which of the following statements are true about file naming conventions? Check all of the boxes that apply.
Korolek [52]

Answer:

last one check it and the second one

Explanation:

8 0
3 years ago
Read 2 more answers
Other questions:
  • After you enter the details for the first selected recipient in the New Address List dialog box, click _______ to add another re
    11·2 answers
  • Software license infringement is also often called software __________.
    11·2 answers
  • A file named data.txt contains an unknown number of lines, each consisting of a single integer. Write some code that creates two
    14·2 answers
  • Kyle asked his supervisor which type of computing model was used when the enterprise first started. She explained that the organ
    14·1 answer
  • 2. A well designed high-volume system will minimize _________ inventory and reduce _____________for the product or service. a) w
    7·1 answer
  • How does natural gas move through pipelines from the well head to the end user thousands of miles away
    5·1 answer
  • Discuss five domains of Instructional technology​
    7·1 answer
  • What are the different Stape of data processing cycle?​
    8·1 answer
  • Develop a program to sort a file consisting of bonks details in the alphabetical order of author names. The details of books inc
    5·1 answer
  • How has 5G become more energy efficient?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!