![evanwall91](/avatars/2932.jpg)
evanwall91
20.02.2020 •
Computers and Technology
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
import java.util.Scanner;
import java.io.PrintWriter;
import java.io.StringWriter;
public class StringStreamOutput {
public static void main (String [] args) {
Scanner scnr = new Scanner(System.in);
String userItem = "";
StringWriter itemCharStream = new StringWriter();
PrintWriter itemsOSS = new PrintWriter(itemCharStream);
System.out.println("Enter items (type Exit to quit):");
userItem = scnr.next();
while (!userItem.equals("Exit")) {
/* Your solution goes here */
userItem = scnr.next();
}
userItem = itemCharStream.toString();
System.out.println(userItem);
return;
}
}
Solved
Show answers
More tips
- F Family and Home How to Properly Fold Napkins in a Napkin Holder?...
- A Auto and Moto What is the Average Lifespan of an Engine in a Car?...
- P Photography and Videography Understanding HDR: How It Works and Why You Need It...
- P Photography and Videography How to Choose the Perfect Photo Paper for Your Images?...
- C Computers and Internet How to Choose an Uninterruptible Power Supply (UPS) for Your Computer: Expert Tips...
- S Science and Technology How to choose a home theater system?...
- A Auto and Moto How to Choose a Car Wash? Tips and Recommendations...
- A Animals and plants How ants survive winter: exploring the secrets of their winter life...
- C Construction and repair How to Choose the Best Underfloor Heating?...
- S Sport When is the Champions League final?...
Answers on questions: Computers and Technology
- C Chemistry Lehach Bounvard. UvU. 4 me friends...
- B Biology 2. What are the three examples Arroyo gives for how we can prepare for the massive impact climate change will have on all of us?...
- M Mathematics Which describes the relationship between the two lines y = 2x -3 y = 1/2x + 3...
- E English 1. What is the topic sentence?...
- M Mathematics No Spam I will mark brainliest whoever properly answers the question. Identify the binomial that is a factor of the polynomial P(x) = 3x3 − 11x2 − 2x + 24....
Ответ:
Brielle will run the marathon faster.
Brielle = 104.8 minutes
Joshua = 157.2 minutes
Step-by-step explanation:
Speed rate = distance /time
Brielle = 1.25 /10 = 0.125 miles per minute
Joshua = 1.5/18 = 0.083333 =1/12 miles per minute
Since 0.125 (Brielle) > 1/12 (Joshua)
Brielle will run the marathon faster.
To calculate the time that takes each one to run the entire race (13.1 miles)
Time= distance / speed
Brielle = 13.1 /0.125 = 104.8 minutes Joshua = 13.1 / (1/12)= 157.2 minutesFeel free to ask for more if needed or if you did not understand something.