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]
2 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]2 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
Given the declarations struct BrandInfo { string company; string model; }; struct DiskType { BrandInfo brand; float capacity; };
Nonamiya [84]

Answer:

Type of myDisk.brand is BrandInfo.

Explanation:

4 0
3 years ago
A program written in a(n) procedural language consists of sequences of statements that manipulate data items. __________________
Alenkasestr [34]

Answer:

true.

Explanation:

According to my research on information technology, I can say that based on the information provided within the question the statement is completely true. Procedural programming is a widely used paradigm that basically gives the program a set of routines or specifications, and the program mixes and matches them as they continuously repeat the process. It is used in many areas, including video game development.

I hope this answered your question. If you have any more questions feel free to ask away at Brainly.

7 0
3 years ago
"assignment is to create a program that will read a value from an array, and then place this value in another array with the loc
White raven [17]

Answer:

#include <iostream>//including libraries

using namespace std;

int main()

{

int arr[6] = { 0,1,2,3,4,5 };//make sure size of arr is 1 less than secArr

int secArr[7];//second array (1 element bigger)

for (int i = 0;i < 6;i++)//looping through each element (6 times)

{

 secArr[i + 1] = arr[i];//transferring elements to second array and shifting by 1 cell

 cout << secArr[i + 1] << endl;//printing elements of second array

}

return 0;//terminating program

}

Explanation:

The array size can range from any number. just make sure to keep arr one less than secArr. This is because we need the room for the extra element. This task is to help you understand how array work and how to parse through them using loops. For loops are the best for this task because even if you think intuitively, they work for as long as there are items in the array. and you can define the size yourself.

5 0
3 years ago
Technician A says that wheel speed sensors are a highly probable cause of illuminated EBC warning lamps. Technician B says that
Blababa [14]

Technician A because

3 0
2 years ago
Which cell address indicates the intersection of the first row and the first column in worksheet?
Rzqust [24]

Answer:

A. A1

Explanation:

Worksheet's Columns are named with Alphabets. i.e. A,B,C,D,E....

And Worksheet's rows are named with numbers. i.e. 1,2,3,4,5....

So the intersection of first row number as "1" and First Column name as "A" is A1 as worksheet displays column name first and then row number.

8 0
3 years ago
Read 2 more answers
Other questions:
  • Mark, David, Tia, and Ashley are team members in a computer programming class. They have been assigned the task of creating a co
    12·1 answer
  • The major difference between a calculator and a computer, when performing calculations, is that a
    14·2 answers
  • Explain why the game of economics has no winner
    8·1 answer
  • _______ data would be useful for creating a report containing last year's revenue, which won't be changing.      A. Integrated B
    12·1 answer
  • Mercury Technical Solutions has been using SSL in a business-to-business environment for a number of years. Despite the fact tha
    5·1 answer
  • An application programming interface (API) is ________. A) the code the application software uses to take advantage of code writ
    11·1 answer
  • What are some (free) good animation websites (for PC/Microsoft) for a short informational video about homelessness?
    15·1 answer
  • As part of a team, you are assigned to create a financial report. One of your tasks is to put the pieces together as other team
    5·1 answer
  • How many operations can a computer perform every second?
    13·1 answer
  • Write a program to output 3 lines of text with the following information:
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!