Challenge: Builder Pattern

In this challenge, you have to implement the builder pattern to solve the given problem.

Problem statement

In this challenge, you have to complete the implementation of the code after studying the partial code.

The task here is to implement the builder pattern to create an assignment. Each assignment is of a subject: it has a level, which means it is either easy, medium, or hard. It also has a due date. The announcement function given to you displays all this information. You have to figure out where to put this function’s definition and how to build the assignment step-by-step.

Input

The provided partial code

Output

Complete implementation of the code and the result after calling the announcement method

Sample input

mathAssignment.announcement(); 

Sample output

"Your Math assignment is: Hard. It is due on 12th June, 2020."

Level up your interview prep. Join Educative to access 80+ hands-on prep courses.