Answered step by step
Verified Expert Solution
Question
1 Approved Answer
add the missing code: Strings group 1 and group 2 are read from input. Each string represents a list of animal ( s ) surrounded
add the missing code: Strings group and group are read from input. Each string represents a list of animals surrounded by and
Assign combinedAnimals with the concatenation of group and group in the order read.
Assign everythingList with a string that contains all the animals in group and group in the order read, separated by and surrounded by and
Ex: If the input is:
bison
penguin
then the output is:
All groups in one line: bisonpenguin
One group of all animals: bison penguin import java.util.Scanner;
public class JoinMultipleFields
public static void mainString args
Scanner scnr new ScannerSystemin;
String group;
String group;
String combinedAnimals;
String everythingList;
group scnrnextLine;
group scnrnextLine;
Your code goes here
System.out.printlnAll groups in one line: combinedAnimals;
System.out.printlnOne group of all animals: everythingList;
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started