answer.
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
nignag [31]
1 year ago
9

Write an expression that will cause the following code to print "18 or less" if the value of user_age is 18 or less. Write only

the expression. Sample output with input: 17 18 or less
Computers and Technology
2 answers:
Tcecarenko [31]1 year ago
7 0

Answer:

user_age = int(input())

if user_age <= 18:

  print('18 or less')

else:

  print('Over 18')

Explanation:

#define user_age with: integer (input(' #from user')

user_age = int(input())

#"if" statement: user_age is less than or equal to 18 than ///

if user_age <= 18:

#Print ('Enter desired output here')

  print('18 or less')

#"else" statement: If above is not true then ///

else:

#Print ('Enter desired output here')

  print('Over 18')

lana [24]1 year ago
6 0

Answer:

if (user_age<=18){

           System.out.println("18 or less");

       }

Explanation:

The above expression in Java will print "18 or less" if the input is less than 18.

Consider a complete java program that request a user to input his/her age below and prints "18 or Less" if the user age is less or equal to 18.

import java.util.Scanner;

public class num2 {

   public static void main(String[] args) {

   Scanner in = new Scanner(System.in);

       System.out.println("enter age:");

       int user_age =in.nextInt();

       if (user_age<=18){

           System.out.println("18 or less");

       }

       else

       {

           System.out.println("greater than 18");

       }

   }

}

You might be interested in
Finish the program to compute how many gallons of paint are needed to cover the given square feet of walls. Assume 1 gallon can
Zepler [3.9K]

Answer:

The program in Python is:

Area = float(input("Area: "))

print("Gallons: "+str(Area/350.0))

Explanation:

The requirement of the program is straightforward and what is required is to divide the inputted area by 350.

Hence, the explanation is as follows:

This line prompts user for Area

Area = float(input("Area: "))

This line calculates and prints the equivalent number of gallons

print("Gallons: "+str(Area/350.0))

4 0
1 year ago
If the input is negative, make numItemsPointer be null. Otherwise, make numItemsPointer point to numItems and multiply the value
Brilliant_brown [7]

Answer:

The code for the given statements are described below.

Explanation:

// Place code below in line 9

if(numItems < 0)  // starting of a loop

{

numItemsPointer = NULL;

}

else  

{

numItemsPointer = &numItems;

numItems = numItems * 10;   // items multiplied by 10

}   // ending of a loop

6 0
2 years ago
A student who used a regression model that included indicator variables was upset when receiving only the following output on th
jeka57 [31]

Answer:

This is a multicolinearity problem and the student should determine the variable(s) that cause(s) the problem and remove it.

Explanation:

This information means that there exists a linear combination between the independent variables. The problem might have developed due to multicolinearity producing almost perfectly linearly dependent columns.

This could also be as a results of single matrix created when the student use an incorrect indicator variables and included an additional indicator column which created linearly dependent columns.

4 0
1 year ago
A ____ partition contains the data necessary to restore a hard drive back to its state at the time the computer was purchased an
Oxana [17]
The answer is back up
8 0
1 year ago
Read 2 more answers
Given a scanner reference variable named input that has been associated with an input source consisting of a sequence of strings
Makovka662 [10]

The code that examines all the strings in the input source and determines how long the longest string (or strings are) is the following:

total = 0; % initial value is zero, in every while loop it will be incremented

while(input.hasNextInt()){

total += input.nextInt( );

}

7 0
1 year ago
Read 2 more answers
Other questions:
  • Gaven's instructor told him to include a personal statement in his work portfolio. Why did his instructor recommend including a
    6·1 answer
  • De'Von is graduating from college and wants to create a professional development plan in order to prepare for his future. What i
    8·1 answer
  • Given: an int variable k, an int array current Members that has been declared and initialized, an int variable memberID that has
    11·1 answer
  • The ______ is the information center that drivers need to refer to when they're NOT scanning the road.
    7·1 answer
  • What is the first step to apply the line and page breaks options to groups of paragraphs in a Word document?
    8·2 answers
  • The blue bar across the top of the screen informs you of the Screen Title, or what step you are on.
    5·1 answer
  • Create a division formula.
    9·1 answer
  • Many documents use a specific format for a person's name. Write a program whose input is: firstName middleName lastName and whos
    12·1 answer
  • How can a signature be added to an email message? Check all that apply.
    10·2 answers
  • Nathan would like to save his PowerPoint presentation as a video that can be replayed easily on any device at full quality. Whic
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!