Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Strings name 1 , name 2 , and name 3 are read from input. Each string represents a list of name ( s ) surrounded

Strings name1, name2, and name3 are read from input. Each string represents a list of name(s) surrounded by "<" and ">".
Assign combinedNames with the concatenation of name1, name2, and name3 in the order read.
Assign groupOfAll with a string that contains all the name(s) in name1, name2, and name3 in the order read, separated by "," and surrounded by "<" and ">".
Ex: If the input is:
then the output is:
All groups in one line:
One group of all names:
import java.util.Scanner;
public class JoinMultipleFields {
public static void main(String[] args){
Scanner scnr = new Scanner(System.in);
String name1;
String name2;
String name3;
String combinedNames;
String groupOfAll;
name1= scnr.nextLine();
name2= scnr.nextLine();
name3= scnr.nextLine();
//your input
System.out.println("All groups in one line: "+ combinedNames);
System.out.println("One group of all names: "+ groupOfAll);
}
}

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored 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

Recommended Textbook for

MFDBS 91 3rd Symposium On Mathematical Fundamentals Of Database And Knowledge Base Systems Rostock Germany May 6 9 1991

Authors: Bernhard Thalheim ,Janos Demetrovics ,Hans-Detlef Gerhardt

1991st Edition

3540540091, 978-3540540090

More Books

Students also viewed these Databases questions

Question

The models used to analyse different national cultures.

Answered: 1 week ago

Question

The nature of the issues associated with expatriate employment.

Answered: 1 week ago