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
"Create a Python program named detect_column_level_data_entry_errors. When complete, you will run this program to produce a diag
11111nata11111 [884]

Answer:

See explaination

Explanation:

Code for detect_column_level_data_entry_errors.py:

# File: detect_column_level_data_entry_errors.py

# The program will produce a diagnostic report that shows data entry errors that cause column

# totals in the data to be out of balance. Will need to fix cleaned_data.txt until errors resolved.

def main():

input_filename = input('Please enter the input filename: ')

infile = open(input_filename, 'r', encoding='utf8')

total_males = 0

total_females = 0

sum_total = 0

print('\n{0:^40}'.format('Column-Level Data Entry Errors'))

print('\n{0:<10}{1:>10}{2:>10}{3:>10}'.format(

'Age Group', 'Males', 'Females', 'Total'))

for line in infile:

age_group, males, females, total = line.split()

males = int(males)

females = int(females)

total = int(total)

print('{0:<10}{1:>10,}{2:>10,}{3:>10,}'.format(

age_group, males, females, total))

if age_group != 'Total':

total_males = males + total_males

total_females = females + total_females

sum_total = total + sum_total

else:

print('{0:<10}{1:>10,}{2:>10,}{3:>10,}'.format(

'Error', (males-total_males), (females-total_females), (total-sum_total)))

infile.close()

main()

8 0
3 years ago
Write about virus in five points.​
kvasek [131]
A computer virus is a malicious software program loaded onto a user's computer without the user's knowledge and performs malicious actions. It can self-replicate, inserting itself onto other programs or files, infecting them in the process.
5 0
3 years ago
Two DHCP servers, Server1 and Server2, are running Windows Server 2016. As the administrator, you create a scope called Scope1.
kumpel [21]

Answer:

The answer is "Option a"

Explanation:

Split-scope is also an easy and simple approach to deliver DHCP consistency and workload management into your system. Server 2008 R2 provides a convenient divide-scope guide which removes several operational efforts but can only be to use if all databases run on R2, and wrong choices can be described as follows:

  • In option b, It uses the Ip address for multicast, that's why it is wrong.
  • In option c, It is wrong because it uses a windows interface, that works on policies.  
  • In option d, It is wrong because it is an administrative feature.

5 0
3 years ago
Which of the following is an example of a logic error?
rusak2 [61]

Answer:

Receiving unexpected results from a program

Explanation:

Logic errors are due to the program not producing a desired result.

6 0
3 years ago
Read 2 more answers
Huffman trees use the _________ of each character to work out their encoding. A) Frequency B) Order in ASCll
Maurinko [17]
I think the answer is C but I could be wrong
5 0
3 years ago
Other questions:
  • Web storage stores data in the browser in
    5·1 answer
  • ________ is typically used as the last string of letters in the name of a website. Group of answer choices the name of the indiv
    13·1 answer
  • An element in an array is 4 bytes long and there are 10 elements in the array. How big is the array?
    6·2 answers
  • A(n) _____ is a telephone facility that manages incoming calls, handling them based on the number called and an associated datab
    5·1 answer
  • How would you describe the relationship between blocks of code and commands?<br>HELP​
    10·1 answer
  • A musical time measurer is a(an)
    10·1 answer
  • ✨Why is among us so addictive I try to play one game but end up playing over 20✨
    15·2 answers
  • Which situations are the most likely to use telehealth? Select 3 options.
    7·1 answer
  • A. Suppose a CPU with a write-through, write-allocate cache achieves a CPI of 2. What are the read and write bandwidths (measure
    13·1 answer
  • _____________are where you get down to business and enter data in a worksheet
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!