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
Hoochie [10]
2 years ago
14

Java write code that inserts useritems into the output string stream itemsoss until the user enters "exit". each item should be

followed by a space. sample output if user input is "red purple yellow exit": red purple yellow
Computers and Technology
2 answers:
Step2247 [10]2 years ago
4 0
If you're a zybooks user.

itemsOSS.print(userItem + " "); 
      userItem = itemCharStream.toString();
GenaCL600 [577]2 years ago
4 0

For the given problem, first read the input from console using scanner class. Then print the input into the print writer and scan the next word using the scanner. This will continues until we did not get ‘Exit’ word. The loop will terminate when user enter exit. Now, append the text and print the string.  

Further Explanation:  

Code: The below Java code that inserts the user items into output stream items until the user enters “exit”.  

// Scanner class to take input from the keyboards

import java.util.Scanner;  

//Enables to find the characters written to a writer as a string

import java.io.StringWriter;  

// Used to print the objects in text-output stream

import java.io.PrintWriter;  

//class definition

public class UserInputsOutputs

{  

   public static void main (String [] args)  

   {  

//Scanner class to read the input  

        Scanner scan = new Scanner(System.in);  

        String userItem = "";  

// printwriter to print items on the console.  

        StringWriter itemCharStream = new StringWriter();  

        PrintWriter stringItems = new PrintWriter(itemCharStream);  

        System.out.println("Enter items (type Exit to quit):");  

        userItem = scan.next();  

// Loop terminates when user enter Exit  

        while (!userItem.equals("Exit"))  

        {  

            stringItems.append(userItem+" ");  

            userItem = scan.next();  

        }  

        userItem = itemCharStream.toString();  

// Display the string  

        System.out.println(userItem);  

        return;  

   }  

}  

Learn more:  

1. A company that allows you to license software monthly to use online is an example of ? brainly.com/question/10410011    

2. Prediction accuracy of a neural network depends on _______________ and ______________. brainly.com/question/10599832    

3. The shape of our galaxy was determined ‘on the inside looking out' by surveying the milky way using ____________ telescopes. brainly.com/question/7866623  

Answer details:  

Grade: College Engineering  

Subject: Computer Science and Engineering  

Chapter: Java Programming  

Keyword:  

Java, programming, console, user, items, string, append, string, writer, scanner, input, output, red, purple, yellow, stream, print, next, loop, while, for, if else statement, println  

You might be interested in
Which fund classification would a focus on only stocks of technology companies match?
Bumek [7]

Answer:

Growth funds

Explanation:

This funds fucos on capital appreciation

5 0
3 years ago
Can run mobile-style apps in the area known as the start screen, while running traditional software in the more familiar desktop
Travka [436]
The correct answer: Yes, mobile-style apps can run in a personal computer's desktop.

That is possible by means of a desktop application called emulatator. An emulator like Bluestacks allows a personal computer to run mobile-style apps by acting as a virtual drive in the personal computer's harddisk. 

Emulation is successful if the system requirements of the mobile-application is met by the personal computer's system attributes such as Random Access Memory abundance, Random Access Memory speed, Processing speed (in some cases core abundance e.g. core 2) etc. 

Some mobile-applications do not work in the personal computer's desktop, however, if this application requires platform specific functions such as mobile device's network provider etc.
4 0
3 years ago
Set-In-Order includes making changes to the layout of the area.A) TrueB) False
Bogdan [553]

Answer:

A) True

Explanation:

Set-In-Order is part of a 5S system approach of making a workplace to be well arranged so there will be smooth operation of employees and working conditions.

Set-In-Order specifically deals with entities in the workplace apparently labeled after being well arranged in their respective places.

Hence, it is TRUE that Set-In-Order includes making changes to the layout of the area.

7 0
3 years ago
Who wants to join my zoom after school 23456+4567
tensa zangetsu [6.8K]
Meeeeeeeeeeeeeeeeeeee
5 0
3 years ago
Guys I need help I cant download anything in the app store I restarted my phone and I know it's not the space on my phone I have
Simora [160]

Can you give me further explanation? For example, how is your phone not letting you download things? What model of a phone is it? what update is it on? and to what extent can you download something?

4 0
2 years ago
Other questions:
  • List the data types that are allowed for SQL attributes.
    7·1 answer
  • Jim wants to develop an app for a specific purpose that would run even when his computer is not connected to the Internet. What
    11·1 answer
  • 1.What is Intellectual Property
    9·1 answer
  • The data in a data warehouse have which of the following characteristics?
    13·1 answer
  • What term is defined as private data placed in a packet with a header containing routing information that allows the data to tra
    13·1 answer
  • Write a program that prints the numbers 1 to 4 on the sameline with each pair of adjacent numbers separated by a single space(1
    5·1 answer
  • Phishing is a broad term that describes any program that is designed to cause harm or transmit information to others without the
    8·1 answer
  • Select the correct answer.
    10·1 answer
  • Which emails go to the draft folder
    5·2 answers
  • What are the advantages of mine shaft gear and the disadvantaged​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!