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
Ainat [17]
3 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]3 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]3 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
Convert<br> 0.625 to binary
Anastaziya [24]

\huge{ \rm{Question:}}

Convert

0.625 to binary

\huge{ \rm{Answer:}}

Translate 0.625 into a fraction. We all know that 0.5 is ½. We know that the remainder, 0.125, is ⅛. Add them together, and you get ½ + ⅛ = ⅝.

Now, in binary, the positions to the right of the point are , which is ½, ¼, and ⅛ respectively.

⅝ is 5 × ⅛. 5 in binary is 101. So, ⅝ is

= 0.101

8 0
2 years ago
Have you ever been presented to someone else's home page of a given website?​
worty [1.4K]

Answer: No, is this the question?

Explanation: Have a stupendous day! <3

6 0
3 years ago
What is the ascii code for the letter D
PilotLPTM [1.2K]

Answer:

068

Explanation:

Or if you want binary it's 01000100

4 0
3 years ago
To join a social network you create an avatar
Luda [366]
Yes you have to do that so people recognize u but not for all social media unless ur talking bout Facebook, Twitter, kik,and I can't think of anything else. At the moment I know lots more just can't think bout it right now
7 0
3 years ago
Read 2 more answers
A form of brainstorming that serves as a visual aid to thinking laterally, helps explore a problem (usually by stating the probl
ELEN [110]

Answer:

The answer is BRAINSTORMING

Explanation:

<em>A visual aid to thinking laterally and exploring a problem, usually by stating the problem in the center  of the page and radiating outward spokes for components of the problem. Each component can then be considered separately with its own spokes, so that each point , thought, or comment is recorded.</em>

7 0
3 years ago
Other questions:
  • Write a function called ReverseLetters that takes an input phrase consisting of a single word and reverses the sequence of lette
    15·1 answer
  • Which of the following might an early 20th -century film producer do in order to draw an audience?
    13·1 answer
  • What does subscribing to a website’s RSS feed provide to a subscriber?
    10·1 answer
  • If str 1 and str2 are both Strings, which of the following expressions will correctly
    13·1 answer
  • Two routers connect with a serial link, each using its S0/0/0 interface. The link is currently working using PPP. The network en
    6·1 answer
  • What is the most common password on the internet?
    11·2 answers
  • What simple machine is most often used to lift the blinds on a window?
    8·2 answers
  • How many people are in Siver, on the game Valorant?
    14·1 answer
  • A health care provider approaches Accenture to help them increase their efficiency through an advanced data science platform.Wha
    8·1 answer
  • _______ is a medium-range wireless network. ________ is a medium-range wireless network. Cellular radio LTE UWB Wi-Fi
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!