Create an email

Report a typo

We need to create an email name for an employee. For this, implement a method that takes a String name and a String surname as an argument. The method should concatenate the name, the surname, and at the end, add the domain "@work.net". Return the result. It's guaranteed that input strings will not be empty.

Use StringBuilder to solve the problem.

Sample Input 1:

Bill
Shates

Sample Output 1:

BillShates@work.net

Sample Input 2:

Elon  
Tusk

Sample Output 2:

ElonTusk@work.net

Sample Input 1:

Bill
Shates

Sample Output 1:

Write a program in Java 17
import java.util.Scanner;

class EmployeeManagement {

public static String createEmail(String name, String surname) {
// write your code here
return null;
}

// Don't change the code below
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
String name = scanner.next();
String surname = scanner.next();

String completeEmail = createEmail(name, surname);

System.out.println(completeEmail);
}
}
___

Create a free account to access the full topic