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
Elenna [48]
4 years ago
9

Write an if-else statement to describe an object. Print "Balloon" if isBalloon is true and isRed is false. Print "Red balloon" i

f isBalloon and isRed are both true. Print "Not a balloon" otherwise. End with newline.import java.util.Scanner;public class RedBalloon {public static void main (String [] args) {boolean isRed = false;boolean isBalloon = false;using java from there
Computers and Technology
1 answer:
Marat540 [252]4 years ago
6 0

Answer:

if(isBalloon== true && isRed==false) //compare the value of isBalloon variable with true value and isRed variable value with false value.

   System.out.println("Balloon");//Print Balloon

else if(isBalloon== true && isRed==true) //compare the value of isBalloon variable with true value and isRed variable value with also true value.

System.out.println("Red balloon");//Print Red  Balloon

else // when no if condition match it will execute.

System.out.println("Not a balloon"); //Print Not a Balloon

Output:

Not a balloon

Explanation:

The "if-else" statement is defined above for the problem which is given on the question. The detailed explanation of the answer is described below--

  • Firstly we need to check the "true" value for the "isBalloon" variable and "false" value for "isRed" variable. This is done in "if" statement separated with and(&&) operator which gives "true" when both are the true statement.
  • Then we need to check the "true" value for the "isBalloon" variable and "isRed" variable. For this, we need to use "else if" statement which executes when "if" statement is false.
  • Then we need to print the "Not a balloon" statement if both cases are false, for this, we use "else" statement which executes when the "if" and "else if" statement are false.

You might be interested in
You decide to store data in the user's browser in order to reduce the amount of data that must be downloaded. What is this proce
Lemur [1.5K]

Answer:

client-side storage

Explanation:

The process of doing this is known as client-side storage. Like the name suggests this saves data that is sent to the user's computer on that computer either as cookies or cached data. This data is then used every time that the user decides to enter the same website or access the same program from the browser. Doing this allows these websites and programs to load much faster the more times that the user decides to enter them.

5 0
3 years ago
Which below best describes JavaScript? *
marysya [2.9K]

Answer:

it is a programing languwage that is useualy used to program visual or text based applications

Explanation:

6 0
3 years ago
Read 2 more answers
Which of the following is a sample IPv4 address?
const2013 [10]

Answer:

The first one, 99.14.242.51 is the only valid IPv4 address listed.

Explanation:

An IPv4 address is formatted as four eight-bit numbers separated by decimals. This means that a valid one will have four numbers from 0 to 255, with decimals in between.

The first one, 99.14.242.51 is a valid IPv4 address.

The second one has the number 342, which is greater than eight bits.

The third one has five octets.

The fourth one is in the wrong format altogether, using what appear to be 32-bit numbers

7 0
3 years ago
Looking at the example below is the type value equal to a string or an integer?
Simora [160]
B. Integer I think that’s the answer
5 0
3 years ago
Read 2 more answers
At which layers of the osi model do 802.11 wireless lans function
Bond [772]
At the data link and physical layers

The 802.11 wireless Lan function is a set of data link and physical layers. Data link layer or the MAC is responsible for effective link-link data transfer, addressing, error detection and frame validation. Physical layer on the other hand helps in placing bits on the network. Basically, all wireless and WI-FI systems conform use these two layers to format and control data to conform with 802.11 wireless Lan standards





7 0
4 years ago
Other questions:
  • A friend has a CD of one of your favorite artists and has offered to let you copy it.
    8·1 answer
  • 24 bit or 16 million colors is often called?
    7·1 answer
  • Where do you access the status report of an assigned task that is open?
    12·2 answers
  • Why should you not perform any personal grooming task while driving?
    5·2 answers
  • When all RGB colors have the same value, the resulting color will most likely be some variation of _______________.
    11·1 answer
  • WHICH COMPUTER COMPONENT CONTAINS ALL THE CIRCUITRY NECESSARY FOR THE OTHER COMPONENTS OR DEVICES TO COMMUNICATE WITH ONE ANOTHE
    12·1 answer
  • Can you log into your account with another phone​
    5·2 answers
  • What is the quickest way to change the format of a table?
    8·2 answers
  • It is not really important to organize your photos because you know that they are on your computer. (TRUE/FALSE)
    10·2 answers
  • Write and test a program that computes the area of a circle. This program should request a number representing a radius as input
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!