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
Wich of these is an example of magnetic storage
kykrilka [37]
C-hard disk, DVD and cd are laser technology, and for usb - flash memory
8 0
3 years ago
It is considered good practice to save a presentation before printing it. true false
Ilya [14]
It is true because it is really a good practise to save a presentation before printing it

5 0
3 years ago
Which of the following are benefits of designing a scalable system? Choose 3 options.
zhenek [66]

Which of the following are benefits of designing a scalable system? Choose 3 options.

  • ability to maintain a high level of service for customers ✔

system will never need to grow again

  • Ability to respond to user volume issues more quickly ✔
  • guaranteed system access for all users ✔

users may never know that a site has experienced tremendous growth

4 0
3 years ago
_______ is the type of vision useful in sensing motion and objects outside normal vision.
Likurg_2 [28]

The answer is peripheral vision, also known as side vision.

3 0
3 years ago
Which of the following people was a member of FFA?
strojnjashka [21]

Answer: Tim McGraw

Explanation:

The National FFA Organization is a youth organization that originally aimed to encourage the youth to venture into agriculture by offering agriculture education to youth in high schools and middle schools. In recent years they started offering education in other areas such as business and technology.

The FFA is quite famous and has had and still has a lot of members. It is of no surprise therefore that some of their alumni are now stars. Famous Country musician Tim McGraw is one such alumni and he was a member of the FFA in his hometown of Start, Louisiana.

Other stars who were part of the FFA include; Taylor Swift and Sterling Martin.

8 0
4 years ago
Other questions:
  • HELP ASAP ILL DO ANYTHING
    6·1 answer
  • 1. An auto repair shop charges as follows. Inspecting the vehicle costs $75. If no work needs to be done,
    9·1 answer
  • What is the meaning of heart symbol in facebook?
    14·1 answer
  • One day you tap your smartphone screen to turn it on, and nothing happens. It appears to be turned off and will not turn on. Wha
    12·2 answers
  • Select the correct answer.
    9·2 answers
  • Hi wanna play fortnite tomorrow add me im batjoker09 no caps or spaces
    13·1 answer
  • What are some ways you can work with templates? Check all that apply.
    9·2 answers
  • How does social media help?<br><br>i will give you the brainliest​
    13·2 answers
  • Which two peripherals are not required to browse the internet?
    8·1 answer
  • Which of the following can be used to enter or display one complete row of information in a range or table without scrolling hor
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!