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
brilliants [131]
3 years ago
12

Give your own example of a nested conditional that can be modified to become a single conditional, and show the equivalent singl

e conditional.
Computers and Technology
1 answer:
victus00 [196]3 years ago
3 0

Answer:

following are the program to the given question:

Program:

x = 0#defining an integer variable that holds a value

if x < 0:#defining if that checks x less than 0

   print("This number ",  x, " is negative.")#print value with the message

else:#defining else block

   if x > 0:#defining if that checks x value greater than 0

       print(x, " is positive")#print value with message

   else:#defining else block

       print(x, " is 0")#print value with message

if x < 0:#defining another if that checks x less than 0

   print("This number ",  x, " is negative.")

elif (x > 0):#defining elif block that check x value greater than 0

   print(x, " is positive")#print value with message

else:#defining else block

   print(x, " is 0")#print value with message

Output:

Please find the attachment file.

Explanation:

In this code, an x variable is defined which holds a value that is "0", in the next step nested conditional statement has used that checks the x variable value and uses the print method that compares the value and prints its value with the message.

In another conditional statement, it uses if that checks x value less than 0 and print value with the negative message.

In the elif block, it checks x value that is greater than 0 and prints the value with the positive message, and in the else block it will print the message that is 0.

You might be interested in
Technologies that function within the established system are called
vesna_86 [32]
<span>Authorizing technologies are technologies that controls the use of system and network resources through authentication and authorization. 
</span><span>Enabling technologies are innovation technologies that drive radical change in the capabilities of a user or culture.
</span>Obstructing technologies include blocking<span> and filtering, content manipulation, attacks.
</span>Preemption means "prior seizure of" and preemptive technologies <span>take control of the operating system from one task and giving </span>it<span> to another task.
</span><span>Technologies that function within the established system are called enabling technologies.</span>
8 0
2 years ago
When developing an estimate, which of the following items is typically marked up with the highest percentage rate?
dmitriy555 [2]

Answer: D. Labor

Explanation:

8 0
1 year ago
Determine the output of the following code segment:
Nataly [62]

Answer:

The output to the given code as follows:

Output:

10

100

64

36

16

4

0

4

16

36

64

Explanation:

In the given java code, an integer variable "i" and an array number is defined, which size is 10, in the next step two for loop is declared, that can be described as follows:

  • In the first loop, array use loop variable "i" use, which minus the value of 5 and multiplies by 2, and it will calculate the square of that number.
  • In the next step, a for loop is declared, that prints these array number variable square.
7 0
3 years ago
When installing a SATA hard drive, is it true or false that you need to move the jumpers on the back of the drive to instruct th
antiseptic1488 [7]

Answer:

This is false.

Explanation:

SATA drives do not have jumpers, because they don't use the master/slave feature. They are connected to the motherboard, and they are ready to work.

The master/slave feature was used by IDE hard drives.15 years ago, most motherboards didn't have too many IDE slots to place more than 1 or 2 HDDs, the IDE cable allowed you to connect 2 drives to 1 cable, greatly increasing your computer's storage space.

It was recommended to set as master the drive connected directly to the motherboard, and the other one as slave.

7 0
3 years ago
Explaing why the findings are different between a general purpose search engine ( google) and a meta search engine ( ask jeeves)
Softa [21]
A lot of people use google and on all search engines the sites are ordered in what people click on the most. Popularest website that fits in with the key words and different people used different websites and different search engines
6 0
3 years ago
Other questions:
  • We have a user Sally Smith who we want to grant the ability to launch applications and browse folders. But we do not want her to
    15·1 answer
  • What term is used to describe a function that uses an algorithm to convert an input of letters and numbers into an encrypted out
    9·1 answer
  • What is word processing and word wrap?
    5·1 answer
  • Bertha was recording a drama club practice. during editing, she noticed that she missed recording the beginning of a shot in the
    10·1 answer
  • Computer is created by aliens?!
    14·1 answer
  • What is a main cause of an aurora?
    8·1 answer
  • Consider a classful IPv4 address 200.200.200.200? What is its implied subnet mask? If we take the same address and append the CI
    12·1 answer
  • Which term is used in object-oriented programming to reference characteristics of an object?
    15·1 answer
  • How do I create a simple percentage function to gather a score for a quiz in PHP?
    14·1 answer
  • Enzo is writing a paper about the similarities and differences between ancient Rome and modern America. Which text structure is
    9·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!