answer.
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
Ainat [17]
2 years ago
11

Write an if-else statement that prints "Goodbye" if userString is "Quit", else prints "Hello". End with newline.

Computers and Technology
2 answers:
vazorg [7]2 years ago
5 0

If you are using Java then the IF statement would be:

If(userSting == "Quit"){

    System.out.println("Goodbye");

}

else

    System.out.println("Hello");

The IF statement will check whether the users input is the word "Quit". If the word is indeed "Quit" then the program will output the word "Goodbye". The ELSE statement on the other hand will only be displayed if the user inputs any other string than "Quit". The program will then output the word "Hello" any other string or number is inputted by the user.

zhannawk [14.2K]2 years ago
4 0

import java.util.Scanner;

public class DetectWord {

  public static void main (String [] args) {

     Scanner scnr = new Scanner(System.in);

     String userString;

     userString = scnr.next();

if(userString.equals("Quit")){

System.out.println("Goodbye");

}

else{

System.out.println("Hello");

}

  }

}

This actually works for anything written and will provide the proper outcome for zybooks

You might be interested in
When performing actions between your computer and one that is infected with a virus, which of the following offers NO risk of yo
DochEvi [55]
What are the options?
3 0
2 years ago
Read 2 more answers
Choose the correct sequence for classifier building from the following.
Alekssandra [29.7K]

Answer:

b

Explanation:

First, we need to initialize the classifier.

Then, we are required to train the classifier.

The next step is to predict the target.

And finally, we need to evaluate the classifier model.

You will find different algorithms for solving the classification problem. Some of them are like  decision tree classification  etc.

However, you need to know how these classifier works.  And its explained before:

You need  to initialize the classifier at first.

All kinds of classifiers in the scikit-learn make use of the method fit(x,y) for fitting the model or the training for the given training set in level y.

The predict(x) returns the y which is the predicted label.And this is prediction.

For evaluating the classifier model- the score(x,y) gives back the certain score for a mentioned test data x as well as the test label y.

8 0
2 years ago
Which of the following represents the bus topology? Multiple Choice All devices are connected to a central device, called a hub.
Yanka [14]

Answer: All devices are connected to a central cable or backbone.

Explanation:

"All devices are connected to a central cable or backbone". Bus Topology refers to a logical or physical network's design. Bus Topology is also the network setup for a LAN (Local Area Network) nodes connected to a "backbone" or cable. The Bus setup connects every single computer and network to a single cable. Among others, the type of cable implemented for bus topology is usually a coaxial cable.

3 0
2 years ago
Drag the tiles to the correct boxes to complete the pairs.
-BARSIC- [3]

1) ECPA is D. Prohibits the government and law enforcement agencies from acquiring information about an individual through telephonic or digital media.

2) COPPA is C. Restricts websites from acquiring information from users below the age of thirteen.

3) OPPA is A. Directs company websites to declare their privacy policies and their expiration dates on their websites if the users are from California.

4) FCRA is B. Regulates credit ratings and how agencies view an individual's credit information.

8 0
2 years ago
Read 2 more answers
In what section of the MSDS would you find information that may help if you use this substance in a lab with a Bunsen burner?
dybincka [34]

Answer:

The answer is "Fire-fighting measures".

Explanation:

This section is used to includes instructions to combat a chemicals flame. It is also known as the identify sources, which include the instructions for effective detonating devices and details for removing devices only appropriate for just a specific situation. It is the initiatives list, that is necessary destruction technology, materials; flaming inferno dangers.

8 0
2 years ago
Other questions:
  • Suppose you define a java class as follows: public class test { } in order to compile this program, the source code should be st
    14·1 answer
  • 1.2.2: Output variable value. Jump to level 1 Write a statement that outputs variable userAge. End with a newline. 1 2 3 4 5 6 7
    12·1 answer
  • The area of a square is stored in a double variable named area. write an expression whose value is length of the diagonal of the
    11·1 answer
  • Assume that the population of Mexico is 128 million and that the population increases 1.01 percent annually. Assume that the pop
    7·1 answer
  • As a security engineer, compare and contrast the pros and cons of deploying hetero vs homogenous networks. Which costs more? Whi
    6·1 answer
  • In the next five years there are expected to be over _____ unfilled jobs in the US in computer science.
    10·1 answer
  • To reduce costs and the environmental impact of commuting, your company decides to close a number of offices and to provide supp
    14·1 answer
  • Alice just wrote a new app using Python. She tested her code and noticed some of her lines of code are out of order. Which princ
    8·1 answer
  • What are the two atomic operations permissible on semaphores?
    8·1 answer
  • In this problem, you will derive the efficiency of a CSMA/CD-like multiple access protocol. In this protocol, time is slotted an
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!