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
densk [106]
3 years ago
11

Write a set of instructions (the code) to prompt the user for an int value and input it using the Scanner class into the variabl

e x and prompt the user for a int value and input it into the variable y.
Computers and Technology
1 answer:
JulsSmile [24]3 years ago
6 0

import java.util.Scanner;

public class MyClass {

   public static void main(String args[]) {

     Scanner scan = new Scanner(System.in);

     int x = scan.nextInt();

     int y = scan.nextInt();

   }

}

I hope this helps!

You might be interested in
When you right-click certain areas of the Word or other Office app windows, a command menu will appear. Group of answer choices
klasskru [66]

Answer:

The answer is "False".

Explanation:

In the word or other office application when we right-click on a certain area of the office, it will provide a common task, like double-click and pick objects.

  • The right mouse button also refers to use and open the pop-up menu, which changes depending on where you select.
  • It allows the computer to mouse additional features, typically known as an optional lowering screen, that's why the given statement is "false".
3 0
4 years ago
2.Write an if /else if statement that carries out the following logic. If the value of variable quantityOnHand is equal to 0, di
Oliga [24]

Answer:

if(quantityOnHand == 0) { cout<<"Out of stock"; }

else if(quantityOnHand > 0 && quantityOnHand <10) { cout<<"Reorder "; }

else if(quantityOnHand >= 10){ }

See Explanation for comments

Explanation:

//This program segment is written in C++

//Only required segment is written

// Comments are used for explanatory purpose

// Program Segment starts here

/*

The following condition tests if quantityOnHand equals 0

If this condition is true, the program prints "Out of stock" without the quotes

*/

if(quantityOnHand == 0) { cout<<"Out of stock"; }

/*

The following condition tests if quantityOnHand  is greater than 0, but less than 10

If this condition is true, the program prints "Reorder " without the quotes

*/

else if(quantityOnHand > 0 && quantityOnHand <10) { cout<<"Reorder "; }

/*

The following condition tests if quantityOnHand  is greater than o equal to 10

If this condition is true, nothing is done

*/

else if(quantityOnHand >= 10){ }

// End of program segment

Assumption: <em>The program assumes that variable </em>quantityOnHand has already been declared

5 0
4 years ago
Propane also known as LP gas, is often mixed with about _______ percent of other gases, such as butane, propylene, and mercaptan
vitfil [10]

Answer:

30

Explanation:

Java - Using a method, how do I "write a program whose input is a character and a string, and whose output indicates the number of times the character appears in the string. Your program must define and call the following method that returns the number of times the input character appears in the input string.

public static int countCharacters(char userChar, String userString)"

4 0
3 years ago
Henry conducted a survey on an ad done by his company. In the survey, he asked people to evaluate the ad and state whether they
Llana [10]
The answer is (C) Rating scale test

These are set of categories designed to get a response from set information about a qualitative or a quantitative attribute. Common examples include a 1-10 rating scale or the Likert response scale. One is required to select a number or an option considered to reflect the perceived quality of something, say a product.






4 0
3 years ago
Which method finds the greatest common divisor of 14 and 35?
Liula [17]

Answer:

gcd method

Explanation:

Given

The code snippet

Required

Which method completes the code

To return the gcd of numbers, simply use the gcd method.

So: the complete code is;

<em>import math</em>

<em>math.gcd(14,35)</em>

6 0
3 years ago
Other questions:
  • Business ethics are?
    9·1 answer
  • Describe mobile computing
    7·1 answer
  • In the Microsoft publisher application, words underlined in red are ____.
    6·1 answer
  • Ou have an application running on Oracle Cloud Infrastructure. You identified that the read and write operations are slowing you
    10·1 answer
  • Finish the code where it says //YOUR CODE HERE
    11·1 answer
  • When considering changing the content of a cell which button should you press to leave the cell as it originally was
    12·2 answers
  • Which pair of devices have the same input motion and different outputs?
    15·1 answer
  • Who used the term" software" first?
    8·2 answers
  • What was the first computer name brand
    12·2 answers
  • A combination of numbers and symbols used to express a calculation. Question 11 options: Formula Formula Bar Worksheet Workbook
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!