Respuesta :

if user output is ''red purble yellow exit'': red purple yellow  import java.util.Scanner;  import java. io.PrintWriter;  import java. io.StringWriter;    public class StringStreamOutput {   public static void main (String [] args) {   Scanner snr = new Scanner(Scanner.in);   Stringuseritem = '''';    StringWriter itemcharStream = new StringWriter();  PrinterWriter itemsOSS = new PrintWriter(itemcharStream);    System.out.printIn(''Enter items (type Exit to open):'');  useritem = scnr.next();    while (!userItems.Equals(''Exit'')) {  /*Your solution goes here*/     UserItem = scnr.nxt();    }     useritem = itemCharStream.toString()   System.out.printin(useritem);     return;     }    }