Answer:
import java.util.Scanner;
public class IdentityVerification {
public static void main(String[] args) {
Scanner scanner = new Scanner(System.in);
// get user password
System.out.println("Enter your password: ");
String userPassword = scanner.nextLine();
// get company secret code
System.out.println("Enter the company's secret code: ");
String companyCode = scanner.nextLine();
// create string that concatenates user password with company secret code
String passwordWithCompanyCode = userPassword + companyCode;
// create string that concatenates user password with user-provided secret code
System.out.println("Enter the secret code: ");
String userProvidedCode = scanner.nextLine();
String passwordWithUserCode = userPassword + userProvidedCode;
// check if the two strings are equal
if (passwordWithCompanyCode.equals(passwordWithUserCode)) {
System.out.println("Access granted");
} else {
System.out.println(userPassword + userProvidedCode + " is denied");
}
}
}