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
Most project files will contain:
Leno4ka [110]

Explanation:

not A or D,

about B and C I'm not sure

7 0
3 years ago
What does this say in morse code?
Furkat [3]

Answer:

That it is time for lunch?

Explanation:

4 0
3 years ago
Read 2 more answers
In general, WAN-specific standards identify specific security requirements for WAN devices. For example, the ___________________
allsm [11]

Answer:

WAN router security standard, Web services standard

Explanation:

Complete statement with blanks filled:

In general, WAN-specific standards identify specific security requirements for WAN devices. For example, the WAN router security standard explains the family of controls needed to secure the connection from the internal network to the WAN router, whereas the Web services standard identifies which controls are vital for use of Web services provided by suppliers and external partnerships.

7 0
3 years ago
You are designing an internet router that will need to save it's settings between reboots. Which type of memory should be used t
Phoenix [80]

Answer:

d. Flash

Explanation:

A flash memory can be defined as an electronic non-volatile memory chip (storage medium) that is typically used on computer systems and other digital devices such as routers, USB flash drives, switches, digital cameras, mp3 players etc. A flash memory is an electronically erasable programmable read only memory (EEPROM) and as such data saved (written) on it can be erased electronically. Also, a flash memory do not require a source of power (electricity) to save or retain data through the use of a floating gate MOSFET (FGMOS) or floating gate transistor.

In this scenario, you are designing an internet router that will need to save it's settings between reboots. The type of memory that should be used to save these settings is a flash memory because it does not require power to write or save data.

8 0
3 years ago
TQ Sustainability & Technology
harkovskaia [24]

A way to make the metro system more sustainable is to use machine learning so as to optimize the frequency of train routes  using passenger load.

<h3>What is a sustainable transport system?</h3>

This sustainable transport system is known to be a kind of system that aids the basic access and growth needs of the society to be met rightly and safely.

This also should be meant in a way that is consistent with human and ecosystem health, and boast equity in all successive generations.

Other methods are the use of Cooling System to lower temperature and non waste of Energy and also lower the Noise Levels.

learn more about Sustainability from

brainly.com/question/25032305

4 0
2 years ago
Other questions:
  • Joaquin is considering a career as an animator and wants to know more about the daily work of an average animator. Which strateg
    11·1 answer
  • Why can't you test a program for run-time errors when it has compile-time (syntax) errors
    6·1 answer
  • In steps<br> Urgent please
    14·1 answer
  • Read the scenario below. Explain why this is not fair use of copyright materials. What should you do instead of using the entire
    10·1 answer
  • The first computer (the eniac was how big
    8·1 answer
  • Troubleshooting a printer that does not work includes a. connecting the printer to your computer b. checking to see if there is
    13·1 answer
  • Windows _____ is a system notification utility and gives quick access to settings for items like screen brightness and network c
    8·1 answer
  • A 'array palindrome' is an array which, when its elements are reversed, remains the same (i.e., the elements of the array are sa
    6·1 answer
  • What does command do
    5·1 answer
  • Ways to ask for help effectively include
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!