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
amid [387]
3 years ago
13

Write an expression that will cause the following code to print "I am a teenager" if the value of userAge is less than 20. Zyboo

ks won't let me edit any other line, and UserAge > 20 was marked wrong. It won't accept the ≥ symbol either.

Computers and Technology
1 answer:
VikaD [51]3 years ago
6 0

Answer:

Replace

if userAge > 20

with

userAge > 19

Explanation:

if userAge > 20  checks if age is 21, 22, 23, 24........

The else condition which prints "I am a teenager" checks if age is 20, 19, 18....

Notice that 20 is inclusive of the else condition; this shouldn't be because for userAge to be less than 20, 20 isn't inclusive

To solve this,

Replace if userAge > 20 with userAge > 19

So that, the else

The else condition which prints "I am a teenager" checks if age is 19, 18, 17, 16....

You might be interested in
What is the value stored at x, given the statements:
iren [92.7K]

Answer:

0.

Explanation:

Given

int x;

x=3/(int)(4.5+6.4)

Required

What is x?

The first line of the code segment declares x as integer. This means that, it will only hold non decimal numbers.

With the above explanation, options (a), (c) and (d) can not be true.

Solving further:

x=3/(int)(4.5+6.4)

The computer evaluates the denominator as:

x=3/(int)(10.9)

The denominator is then converted to an integer. So, we have:

x = 3/10;

3/10 = 0.3 but

Recall that: <em>x will only hold non decimal numbers.</em>

So:

x = 0;

5 0
2 years ago
Look at (d), is it accurate? ​
Angelina_Jolie [31]

Answer:

ya

Explanation:

8 0
3 years ago
Read 2 more answers
Write a method called shifiLeft that takes a 2D array (that could be jagged) as an input and returns the same array with the ele
kumpel [21]

Answer:

Check the explanation

Explanation:

public static void main(String[] args){

     int[][] twoDimenArray = new int[2][];

     //first row has 3 columns

     twoDimenArray[0] = new int[3];

     

     //second row has 4 columns

     twoDimenArray[1] = new int[4];

     int counter = 0;

     //initializing array

     for(int row=0; row < twoDimenArray.length; row++){

   

        for(int col=0; col < twoDimenArray[row].length; col++){

           twoDimenArray[row][col] = counter++;

        }    

     }

     //printing array

     for(int row=0; row < twoDimenArray.length; row++){

        System.out.println();

        for(int col=0; col < twoDimenArray[row].length; col++){

           System.out.print(twoDimenArray[row][col] + " ");

        }    

     }

  }    

}

<u>Output </u>

0 1 2  

3 4 5 6

8 0
3 years ago
Please help,
goldfiish [28.3K]

Answer:

i think it most be idea like me i am building an app i have an idea on how the graphics would be

3 0
2 years ago
Read 2 more answers
You are writing a paragraph in a word processor. You
MAVERICK [17]

Answer:

Explanation:

I mean I would copy and paste it. I hope thats right

4 0
3 years ago
Other questions:
  • Write the SQL statements that define the relational schema (tables)for this database. Assume that person_id, play_id, birth_year
    8·1 answer
  • A developer writes a trigger on the Account object on the before update event that increments a count field. A workflow rule als
    12·1 answer
  • To create a file in dos edit, type ____ at the command prompt to start dos edit, and then begin typing in the document window.
    8·1 answer
  • Impact of computer on education
    6·2 answers
  • Write an expression using membership operators that prints "Special number" if special_num is one of the special numbers stored
    12·1 answer
  • A computer's CPU and hard drive are found in the
    12·2 answers
  • What are horizontal and vertical page break? how and where are these inserted?​
    10·1 answer
  • I need help. I wanna help a friend by giving him my powerpoint but I dont want him to steal my work. Is their anyway to restrict
    8·1 answer
  • Line formatting can be accomplished by using
    15·1 answer
  • What should you do if a headset plugged into your computer is not working properly?
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!