Job simulation

Report a typo

You are an employee of FakeCorp. You have been successfully imitating work and getting paid for it for several years. Your boss has become suspicious. You've been tasked with using variables name, status, errorCode and methods printf and format to display the following message:

Result of work - Lazy employee detected! Error code: 2

But something went wrong: there is an error in the code. Your task is to fix the code and display the result.

Sample Input 1:

Sample Output 1:

Result of work - Lazy employee detected! Error code: 2
Write a program in Java 17
public class Main {
public static void main(String[] args) {
String name = "Lazy";
String status = "detected";
int errorCode = 2;

//Fix code below
String formattedMessage = String.format("%s employee %d! Error code: %s", name, status, errorCode);
System.out.printf("Result of work - %c", formattedMessage);
}
}
___

Create a free account to access the full topic