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
A radio and communications security repairer is responsible for both radio and satellite communication systems.
natita [175]
I'm almost certain the answer is true
3 0
3 years ago
Read 2 more answers
Type the correct answer in the box. Spell all words correctly.
marissa [1.9K]

Answer:

GIF

Explanation:

The Graphic Interchange Format (GIF) is the image format that supports small animations made out of sequential frames played in sequence and possibly in loops, depending on the parameters saved in the file.

The Animated GIFs are seen everywhere these days on social medias, where people use them to express their emotions in bigger and  more elaborate ways then emoticons.

6 0
3 years ago
_____ is a major factor in the widespread use of global information systems
Paha777 [63]

Answer:

E-business

Explanation:

7 0
4 years ago
An artificial satellite in which people can live and work for long periods is called a
morpeh [17]
A space station is an artificial satellite in which people can live and work for a long period of time. Space station is placed on the space for the astronaut in researching things on the space and universe.
8 0
3 years ago
Read 2 more answers
Use a spreadsheet to solve this business problem. The owners of an electronics store want to find which of their products makes
Tom [10]

Answer:

Computer Monitors earned him maximum profit. For details, please check the attachment.

Explanation:

Please check the attachment.

Download xlsx
5 0
4 years ago
Other questions:
  • 2. Write a program that askes the user to enter a positive number not greater than 10.the program then must display the triangle
    12·1 answer
  • Which scientific law states that if a light source radiates isotropically, the light intensity falls off the further you get fro
    5·1 answer
  • Python
    14·1 answer
  • 2 A_______<br> uses graphics or pictures to help the user navigate and<br> access programs
    14·1 answer
  • Why is the following statement true - ideally, your information is abbreviated
    10·2 answers
  • In a management information system, the quality of information is determined by its usefulness to users, and its usefulness dete
    8·1 answer
  • Lets say if my computer shut down every 10 minutes. What can you do to solve the problem. Hint: Use these word in you answer: ha
    10·2 answers
  • Which expression is equivalent to 3x + 3x + 3x?<br><br> From Performance Matters
    11·2 answers
  • Websites not only give us information, but they also inspire designers in their layouts, illustrations, images, typefaces, and c
    6·1 answer
  • The price of an item you want to buy is given in dollars and cents. You pay for it in cash by giving the clerk d dollars and c c
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!