Initialize a service appointment
A constructor runs when new builds an object, so every new object starts with a valid state.
Your task
Finish the AppointmentPlan constructor and build three plans.
class AppointmentPlan {
public String customerName;
public Integer durationMinutes;
public AppointmentPlan(String customerName, Integer durationMinutes) {
}
public String summary() {
return customerName + ' :: ' + durationMinutes + ' min';
}
}Requirements
- Declares the two-parameter constructor should be present
- Standard plan should be
Standard: Acme onboarding :: 45 min - Half-hour plan should be
Half-hour: Data review :: 30 min - Zero-minute plan should be
Zero minutes: Quick check :: 15 min - Short-length plan should be
Team sync :: 15 min - Long-length plan should be
Kickoff :: 90 min