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
Which of the following statement is correct ? A . potential difference is measured by ammeter . B . The unit of potential differ
lina2011 [118]

Answer:

C.Battery is a source of potential difference in a circuit.

Explanation:

A battery is a source of electrons and positive ions which sets one of it's terminal (cathode) at negative potential and the other (anode) at positive potential. Hence a battery is a source of electricity(electrons) which sets a potential difference across the battery terminals.

4 0
3 years ago
How to do a Spreadsheet ??
sveticcg [70]

Answer:

Open Microsoft spreadsheet then input the data to the computer

3 0
3 years ago
The _______ command was developed by nicholas harbour of the defense computer forensics laboratory.
Lena [83]
Hi! The answer is dcfldd
3 0
3 years ago
Which is an operational process performed by AWS for data security? a.Background virus scans of EBS volumes and EBS snapshots
Tresset [83]

Answer:

B. All decommissioned magnetic storage devices are degaussed and physically destroyed in accordance with industry-standard practices.

Explanation:

6 0
3 years ago
An instance variable name of type String, initialized to the empty String. An instance variable score of type int, initialized t
timofeeve [1]

Answer:

public class Class {

   private String name ="";

   private int score = 0;

   //Method SetName

   public void setName(String newName){

       name = newName;

   }

//Method SetScore

   public void setScore(int newScore){

       score = newScore;

   }

//Method GetName

   public String getName() {

       return name;

   }

//Method GetScore

   public int getScore() {

       return score;

   }

}

Explanation:

  • The class called Class is implemented in Java programming language
  • It has two fields (instance variables name and score)
  • Methods for setting the values of variables (mutator methods) or setters
  • Methods for getting the values of the variables (accessor methods) getters
8 0
3 years ago
Other questions:
  • When u look at a green object through red glass the object will appear
    11·2 answers
  • Write a program to read customer number, Name, loan amount, interest rate and time of repayment. Calculate and display the EMI .
    9·1 answer
  • When a defendant pleads guilty to one offense just to have another offense dropped, this is what type of plea bargain
    12·2 answers
  • Can someone tell me how to use the Human machine language for beginners? or websites I should use.​
    7·1 answer
  • If you have a database of books in the library and you would like to find all books published after January 1, 2008, what criter
    7·1 answer
  • Hi Alaza, when you submit this form, the owner will be able to see
    12·1 answer
  • Select the correct images Jane has to pick images that portray action photography. Which of these images would she pick? please
    9·1 answer
  • Who plays rocket league on xbox?
    15·2 answers
  • MCQ: Which of the following network is confined to a relatively small area?
    5·2 answers
  • WILL GIVE BRAINLIST Which statements accurately describe electronic tools? Check all that apply. Electronic tools collect large
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!