Question: 5 2 8 0 4 0 . 3 4 8 9 5 2 8 . 9 3 z q y 7 Jump to level 1
Jump to level
Strings batch batch and batch are read from input. Each string represents a list of animals surrounded by and
Assign combinedAnimals with the concatenation of batch batch and batch in the order read.
Assign allTheltems with a string that contains all the animals in batch batch and batch in the order read, separated by and surrounded by and
Ex: If the input is:
tortoise
kangaroo
bird
then the output is:
All batches in one line: tortoisekangaroobird
One batch of all animals: tortoisekangaroobird
import java.util.Scanner;
public class JoinMultiplefields
public static void mainString args
Scanner scnr new Scanner
System.in;
String batch;
String batch;
String batch;
String combinedAnimals;
String allTheItems;
batch scnr nextline;
batch scnr nextline;
batch scnr nextline;
your code goes here
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
