Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

5 2 8 0 4 0 . 3 4 8 9 5 2 8 . 9 3 z q y 7 Jump to level 1

528040.3489528.93zqy7
Jump to level 1
Strings batch1, batch2, and batch3 are read from input. Each string represents a list of animal(s) surrounded by "(" and ")".
Assign combinedAnimals with the concatenation of batch1, batch2, and batch3 in the order read.
Assign allTheltems with a string that contains all the animal(s) in batch1, batch2, and batch3 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: (tortoise)(kangaroo)(bird)
One batch of all animals: (tortoise/kangaroo/bird)
import java.util.Scanner;
public class JoinMultiplefields {
public static void main(String[] args){
Scanner scnr = new Scanner(
System.in);
String batch1;
String batch2;
String batch3;
String combinedAnimals;
String allTheItems;
batch1= scnr. nextline();
batch2= scnr. nextline();
batch3= scnr. nextline();
Y** your code goes here */
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions