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
goldfiish [28.3K]
3 years ago
12

Java - Given a String variable response that has already been declared, write some code that repeatedly reads a value from stand

ard input into response until at last a Y or y or N or n has been entered.
ASSUME the availability of a variable, stdin , that references a Scanner object associated with standard input.
Computers and Technology
1 answer:
Rainbow [258]3 years ago
4 0

Answer:

import java.util.Scanner;

public class Main

{

public static void main(String[] args) {

   

    Scanner stdin = new Scanner(System.in);

    String response = "";

 while (true) {

     System.out.print("Enter the response: ");

     response = stdin.nextLine();

     

     if (response.equals("Y") || response.equals("y") || response.equals("N") || response.equals("n"))

         break;

 }

}

}

Explanation:

Create a string variable called response

Create a while loop that iterates until a condition is specified to stop

Inside the loop:

Ask the user for the input

Check if input equals "Y", "y", "N" or "n". If input equals any of these letters, stop the loop. Otherwise, continue asking for a new response

You might be interested in
You are running Windows 8 on your laptop. You install a 64-bit application on it. Where will this application reside on your com
melamori03 [73]
In the Program Files folder.
6 0
3 years ago
Read 2 more answers
Why not to use settimeout in angular.
barxatty [35]

Answer:

start with what you know

Explanation:

you can learn alot

4 0
3 years ago
The Horse table has the following columns:
dimulka [17.4K]

See below for the statement to insert the data values

<h3>How to insert the records?</h3>

To do this, we make use of the insert statement.

This is done using the following syntax:

INSERT INTO table_name (column_name, ...) VALUES (value, ...)

Using the above syntax and the data values, we have the following insert statement.

INSERT INTO Horse (RegisteredName, Breed, Height, BirthDate)

VALUES ('Babe Quarter', 'Horse', '15.3', '2015-02-10'), ('Independence', 'Holsteiner', '16.0', '2017-03-13'), ('Ellie', 'Saddlebred', '15.0', '2016-12-22')

INSERT INTO Horse (Breed, Height, BirthDate) VALUES ('Egyptian Arab', '14.9','2019-10-12')

Read more about SQL at:

brainly.com/question/10097523

#SPJ1

4 0
2 years ago
A conventional uniprocessor has __________ .
lys-0071 [83]

Answer:

The correct option to the following question is option (A).

Explanation:

SISD is used in the uni-processors systems which executes an individual instruction streams at a time by which we control an individual memory for the storage of data.

It is the flow or the sequence of an individual data or instructions which controlled on the systems.

Whereas SISD is different from the SMID and it is not used in the Uni-processor systems

3 0
3 years ago
How can artificial intelligence be used in learning science?
tiny-mole [99]

Artificial intelligence can be used to help science students research and verify their research. It is also a very interesting topic to study in general.

Hope that helped!!! k

5 0
3 years ago
Other questions:
  • When a job is sent to other countries, as many programming jobs have been, it is said to have been datamined.
    11·1 answer
  • What is the most happy job work? that can earn $1000 per day at homes? show company website links
    5·1 answer
  • add is a method that accepts two int arguments and returns their sum. Two int variables, euroSales and asiaSales, have already b
    11·1 answer
  • ________ are often organize commonly used commands into a set of tabs.
    5·1 answer
  • Example 4-1: The styles for the main content of an HTML document main { clear: left; } main h1 { font-size: 170%; } main h2 { fo
    13·1 answer
  • Keyword stuffing is considered to be a black hat technique for SEO and is highly suggested today by Google.
    6·1 answer
  • When you navigate inside a compressed folder, you click the
    6·1 answer
  • oftware that is free and whose code can be accessed and potentially modified by anyone is referred to as _____. shared source fi
    11·1 answer
  • Which tags do you use to write the header and items of an ordered list on a web page?
    14·1 answer
  • In the chemical reaction of baking cookies, the product is?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!