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
Which option would a computer engineer most likely create? A) a programming language to run a new software program B.) the part
Zolol [24]

pogram b

Explanation:

3 0
3 years ago
What does the Disk Defragmenter tool do
Kobotan [32]
Disk Defragment Free will quickly defragment files on your hard drive, optimize file placement and consolidate free space to ensure the highest data access speed possible.
6 0
3 years ago
A document can contain either footnotes or endnotes but not both.<br> True<br> False
serg [7]
This is false. They can contain both.
6 0
3 years ago
What will happen if more than 2 devices attempt to access the internet ?
Lemur [1.5K]
Well it depends what kind of Internet u have
5 0
3 years ago
Which two statements are true about an OS?
Marat540 [252]
The correct answers are A and C
Please give me brainless
6 0
3 years ago
Other questions:
  • A ____________________ can be used to hierarchically represent a classification for a given set of objects or documents. A. taxo
    10·1 answer
  • How should you dress for a phone interview
    12·2 answers
  • What is the purpose of the print area feature​
    11·1 answer
  • Which of these is a cultural form? A. Art B. Food C. Clothes D. All of the above
    8·2 answers
  • Which technology forms the foundation for cloud computing? forms the foundation for cloud computing.
    12·2 answers
  • You are working in the media industry, and you have created a web application where users will be able to upload photos they cre
    5·2 answers
  • The parameter passing mechanisn used in C is
    5·2 answers
  • The duties of a database administrator include determining which people have access to what kinds of data in the database; these
    13·2 answers
  • the two main ways in which marketers address the competition with their strategies are by satisfying a need better than a compet
    6·2 answers
  • listen to exam instructions a small business called widgets, inc. has hired you to evaluate their wireless network security prac
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!