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
andrew11 [14]
3 years ago
13

Explain why the program did not print "clap", and how to fix it.

Computers and Technology
1 answer:
lara [203]3 years ago
6 0

Answer:

Because you're using "elif".

If I were to have this code:

if *blank*:

    *action 1*

elif *blank*:

    *action 2*

If and elif is basically saying "one or the other". Since 10 is >= 2, it prints out only whistle. Instead of elif, you were to replace them all with "if", it would print out:

whistle

snap

clap

You might be interested in
What does the<br> command do
I am Lyosha [343]
Please specify your question.
6 0
3 years ago
A web-based application encounters all of the connectivity and compatibility problems that typically arise when different hardwa
andrezito [222]

Answer:

False

Explanation:

A web-based application encounters connectivity and compatibility relate to data server. It does not belong to any hardware environments.

A web based application is accessed over network.They run inside a web browser. Small of program is download to user's desktop, but this processing is done over internet.

6 0
3 years ago
Convert infix to postfix
kvv77 [185]

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.
4 0
3 years ago
covers a wide variety of applications such as web and computer-based training (CBT), and social networks. a. E-learning b. Model
mixer [17]

Answer:

Option (a) is the correct answer of this question.

Explanation:

E-Learning means that Electronic Learning. It covers a broad spectrum of applications, including online and computer-based training (CBT) and public networks.E-Learning is learning to use new technology to navigate curricula beyond a conventional classroom is known as Electronic learning.

  • E-learning is a nurturing environment that allows use of information and communication technologies (ICTs) as a pedagogical tool.
  • E-learning not a program distributed over a Disc or CD-ROM, a video tape or a TV channel.

<u>There are two types of E-learning are known as</u>:-

  1. Synchronous E-learning.
  2. Asynchronous E-learning

6 0
3 years ago
Write c++ program to find maximum number for three variables using statement ?
Anastaziya [24]
The variable 10 ~ 810 would equal off to 10 leaving 40 left over..
5 0
3 years ago
Read 2 more answers
Other questions:
  • 1) What is Net beans
    6·1 answer
  • Investigations involving the preservation, identification, extraction, documentation, and interpretation of computer media for e
    12·1 answer
  • What is a device that enables a spacecraft crew to exit from the spacecraft and launch tower in the event of a crisis before tak
    8·1 answer
  • Consider a system running 10 I/O-bound processes and 2 CPU-bound process. Assume that the I/O-bound processes issue an I/O opera
    9·1 answer
  • A user on a home network needs to boost the signal of the wireless router. What should the user purchase to accomplish this?
    14·1 answer
  • State the rule of 72 for the number of years to halve.
    8·1 answer
  • Different between client server architecture and peer to peer architecture​
    11·1 answer
  • Please help meh T^T Which of the following describes an application error? Select 2 options.
    5·2 answers
  • Good Morning! Please Help!
    15·1 answer
  • 1.1 what is the osi security architecture? 1.2 what is the difference between passive and active security threats? 1.3 list and
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!