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
Refer to the exhibit. If a hacker on the outside network sends an IP packet with source address 172.30.1.50, destination address
Luden [163]

Answer:

The packet is dropped

Explanation:

To see why we need to understand the ACL or Access-control list that is a list of permissions that specify which users can access or modify certain things in a system. Because the source IP  doesn't have any parameter and is just a plain IP and packet the Cisco firewall will drop the packet based on the ACL rules, in other words, the Cisco firewall doesn't have any parameter that allows it to verify the permission-level of the sender, therefore, the packet will drop.  

7 0
3 years ago
How do I fix when it hits the second session it skips scanf..
kozerog [31]

Answer:

the answer can be found HERE:

https://stackoverflow.com/a/13473767

put a leading space in the scanf(" %c", &op)

Explanation:

#include <stdio.h>

#include <unistd.h>

#include <ctype.h>

main() {

double first, second;

char op;

while(1){

printf(" Calculator\n");

printf("\n 7 8 9 / \n 4 5 6 x \n 1 2 3 - \nEnter operator: ");

scanf(" %c", &op); //entering operators such as + - \ *

printf("Enter two operands:");

scanf("%lf %lf", &first, &second); //entering operands such as 1 2 5 8 12 414

switch (op) { // printing the math

case '+'://if its +

   printf("%.1lf + %.1lf = %lf\n\n", first, second, first + second);

   break;

case '-'://if its -

   printf("%.1lf - %.1lf = %lf\n\n", first, second, first - second);

   break;

case '*'://if its *

   printf("%.1lf * %.1lf = %lf\n\n", first, second, first * second);

   break;

case '/'://if its :

   printf("%.1lf / %.1lf = %lf\n\n", first, second, first / second);

   break;

default://if its not + - / *

   printf("error!");

}

}

}

4 0
3 years ago
Role and importance of internet in today's world
Nadusha1986 [10]

Explanation:

In today's world Internet is the main thing in our daily life. Without it there would be a lot of troubles and we use Internet for research, watching videos etc

6 0
3 years ago
Read 2 more answers
Drag the tiles to the correct boxes to complete the pairs.
Mice21 [21]

Answer:

Operation open purpose

8 0
3 years ago
Read 2 more answers
Come up with a system, using only
masha68 [24]

Explanation:

material

3 balões de erlenmeyer. .balanca

funil. . carbonato de

. rolha

. tubo abdutor

. seringa

8 0
3 years ago
Other questions:
  • Return to the Product Mix worksheet. Benicio wants to provide a visual way to compare the scenarios. Use the Scenario Manager as
    6·1 answer
  • How to write a program that prompts the user to input two POSITIVE numbers — a dividend (numerator) and a divisor (denominator).
    13·1 answer
  • Which two statements give good definitions of financial credit
    8·1 answer
  • The set of instructions that tells a computer
    12·2 answers
  • How does the government is i.t to run the country?
    9·1 answer
  • __________ refers to the idea that eachemployee should report
    14·1 answer
  • (1) Prompt the user to enter a string of their choosing. Output the string.
    11·1 answer
  • Write Python programs to solve the following two problems. Your programs should be named according to the problem descriptions a
    9·1 answer
  • PLEASE HELP FAST!!!!!!Color photographs often look better on which type of photo paper
    7·1 answer
  • assuming the default gateway is connected to the internet, what type of internet access would this server have?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!