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
tia_tia [17]
3 years ago
9

Write an expression that prints 'You must be rich!' if the variables young and famous are both True. Sample output with inputs:

'True' 'True' You must be rich!
Computers and Technology
1 answer:
Pavel [41]3 years ago
3 0

Answer:

Following are the expression in the Java language

public class Main

{

public static void main(String[] args) // Main method

{

boolean young= true; // variable declaration

boolean famous= true;// variable declaration

if(young && famous) // check the condition

System.out.println("You must be rich  "  );// display message

}

}

Output:

You must be rich

Explanation:

Following are the description of the above statement

  • Declared a variable "young " of the boolean type that is initialized with the "true" value.
  • Declared a variable "famous " of  the boolean type that is initialized with the "true" value.
  • Check the condition of if() block.If the condition is true then it executed the condition inside the if block.
  • Finally ,print the message  "You must be rich!"
You might be interested in
Expand and simplify the following expressions. 1/2 [ 2x + 2 ( x - 3)] *​
Lerok [7]

Answer: 2

x

−

3

Explanation:

4 0
3 years ago
What does the proofreading mark "..." mean?
scZoUnD [109]

Answer:

I believe "..." means that you need to go further in depth with your writing.

3 0
3 years ago
Read 2 more answers
Calculate the weighted grade for each student that appears in the data file. You may calculate the grade based on total earned p
lutik1710 [3]

Answer:

I don't know the answer, sorry

6 0
3 years ago
What should be done on a tablet in order for that tablet to cease all network connections?
ankoles [38]

Answer:

Turn On Airplane Mode

Explanation:

Turning off cellular does not turn off wifi.

Turning off wifi does not turn off cellular.

Turning off location services does not affect your network connections.

Airplane mode is what turns off all network connections.

3 0
3 years ago
Write the definition of a function named alternator that receives no parameters and returns true the first time it is invoked, r
Nataly [62]

Answer:

The solution code is written in C++

  1. bool STATUS = true;
  2. bool alternator ()
  3. {
  4.    if(STATUS){
  5.        STATUS = false;
  6.        return true;
  7.    }else{
  8.        STATUS = true;
  9.        return false;
  10.    }
  11. }

Explanation:

We need a global variable to track the status of true or false (Line 1).

Next, create the function alternator (Line 2) and then check if current status is true, set the status to false but return the previous status boolean value (Line 5-6). At the first time of function invocation, it will return true.

The else block will set the STATUS to true and return the false (Line 7-9).

3 0
3 years ago
Other questions:
  • What will happen if you change data that is used in a formula
    10·1 answer
  • Esther has acquired an associate's degree in information technology and certifications in PageMaker and Illustrator. Which caree
    8·2 answers
  • 2.Use loops to create a 4X6 matrix in which the value of each element is two times its row number minus three times its column n
    13·1 answer
  • Justin Blake and Raegan Beast anyone?? I miss Jaegan a ton and I need a fangirl to talk to.
    13·1 answer
  • Select the correct answer.
    11·1 answer
  • How are envelopes and letterheads different
    7·1 answer
  • The computer mouse are used for
    15·2 answers
  • D is the correct answer
    8·2 answers
  • Imagine that you are preparing a multimedia presentation. What are the four things you need to consider when getting started?
    14·2 answers
  • Given two objects represented by the tuples (22, 1, 42, 10) and (20, 0, 36, 8):
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!