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
Masteriza [31]
3 years ago
8

Write an if statement that prints the message ""The number is not valid"" if the variable distance is outside the range 100 thr

ough 2000(both inclusive).
Computers and Technology
1 answer:
Slav-nsk [51]3 years ago
5 0

Answer:

The solution code is written in Python:

  1. if(distance < 100 or distance > 2000):
  2.        print("The number is not valid")

Explanation:

In this question either one of the two conditions (distance < 100 or distance > 2000) is met, the error message should be generated. Python offers the "or" keyword as a logical operator. The "or" keyword will join two conditions and so long as one of them is True, the final outcome will be evaluated to True. For example, if distance = 90 the error message will be printed. If distance is 2500, the error message will also be printed.

You might be interested in
Write a program using Python that prompts for an integer and prints the integer, but if something other than an integer is input
Tcecarenko [31]

Answer:

#program in Python

#read until user Enter an integer

while True:

   #try block to check integer

   try:

       #read input from user

       inp = int(input("Enter an integer: "))

       #print input

       print("The integer is: ",inp)

       break

   #if input is not integer

   except ValueError:

       #print message

       print("Wrong: try again.")

Explanation:

In try block, read input from user.If the input is not integer the print a message  in except block.Read the input until user enter an integer. When user enter an  integer then print the integer and break the loop.

Output:

Enter an integer: acs                                                                                                      

Wrong: try again.                                                                                                          

Enter an integer: 4a                                                                                                      

Wrong: try again.                                                                                                          

Enter an integer: 2.2                                                                                                      

Wrong: try again.                                                                                                          

Enter an integer: 12                                                                                                      

The integer is:  12  

7 0
3 years ago
Read 2 more answers
Describe the components of the Web. Your friend wants to create and publish a Web page. He tells you that he wants to learn the
iren [92.7K]

Answer:

The answer is "HTML".

Explanation:

We will suggest him to learn HTML language because It stands for HyperText Markup Language. It is a markup language that uses a build a web page and these sites are normally viewed on the web browser.

  • It is the language for development used in the World Wide Web.
  • This language includes writing, links, images, videos, and audio files.  
  • Each one of these kinds of content is tagged and described by HTML, which uses a web browser can display it correctly.
3 0
2 years ago
1. Type a statement that reads a user-entered integer into variable numUsers. Assume scnr already exists.
ASHA 777 [7]

Answer:

Question 1:

int numUsers = scnr.nextInt();

Question 2:

public class OutputExample {

public static void main (String [] args) {

int numCars = 99;

Scannerscnr=new Scanner(System.in);

numCars=scnr.nextInt();

System.out.println("There are "+numCars+" cars");

return;

}

}

Question 3:

import java.util.Scanner;

public class Errors {

public static void main(String [] args) {

int userNum = 5;

System.out.println ("Predictions are hard. ");

System.out.print("Especially ");

System.out.print("about the future.");

System.out.println("Num is: "+userNum);

return;

}

}

Explanation:

In Question 1, the statement int numUsers = scnr.nextInt();  reads a new integer value from the keyboard and assigns it to the variable numUsers.

In question 2, Concatenation is used to format the print output.

In question 3, care is taken to fix each of the syntax errors (missing double quotes, semi-colon, concatenation)

3 0
3 years ago
The ______ clause allows us to select only those rows in the result relation of the ____ clause that satisfy a specified predica
baherus [9]

Answer:

1. Where,

2. From

Explanation:

In SQL query language when working on a database, a user can use certain clauses to carry out some functions.

Hence, The WHERE clause allows us to select only those rows in the result relation of the FROM clause that satisfy a specified predicate.

This is because the "Where clause" selects the rows on a particular condition. While the "From clause" gives the relation which involves the operation.

5 0
2 years ago
Give two reasons why cloud computing could be detrimental to a company.
dimulka [17.4K]

Security/Insider threats.

As much as cloud computing is good for your organization, just know that someone is looking after your data. The cloud provider does everything for you from maintenance to managing security. The bigger picture here is that users are entrusting their data to someone else. Although the work of cloud providers is to ensure that your data is safe, some are not always looking after your best interests.

Cyber-attacks.

Any time your data is stored on the cloud, you are at a higher risk of cyber-attack. Vulnerabilities such as DDoS attacks might occur and this single point of failure is in the cloud. As cloud computing continues to become more sophisticated, so do cyberattacks. As much as the security is right, hackers will go to any lengths to penetrate the systems.  


3 0
3 years ago
Other questions:
  • Chandra, a student working on a group project, is trying to decide how to have the whole group suggest revisions for an essay. S
    10·1 answer
  • What is the name for software designed to find and open Web documents?
    8·1 answer
  • ​User documentation _____. Group of answer choices ​allows users to prepare overall documentation, such as process descriptions
    9·1 answer
  • Suppose Alice, Bob, and Carol want to use secret key technology to authenticate each other. If they all used the same secret key
    10·1 answer
  • Briefly explain what are JavaScript librairies​
    12·1 answer
  • When troubleshooting firewalls, you should never attempt to repeat the problem because you could do more damage. T/F
    6·1 answer
  • Arrange the binary number in increasing order of their arithmetic output in the decimal number system ?
    9·1 answer
  • Based on the screenshot below which letter do you select to sort the items in an alphabetical order?
    9·1 answer
  • 4.8 code practice question 2
    10·1 answer
  • Which of these is installed only on Apple smartphones and tablets?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!