Appointment Scheduler
Appointment Scheduler
Hand_On_Projects;
import java.util.ArrayList;
import java.util.Scanner;
/*
You Have Been given a task to create Appointment Scheduler application for
beauty saloon. The application should accept date and time to schedule appointment.
The application can only take 10 appointments each day 3 in morning 7 in
afternoon(>= 12:00 and < 18:00).
the application should tell me if appointment is taken or not.
If appointment is made on 1st Jan Wish customer happy new year with 30% discount
message.
*/
class Details{
protected String date,time;
Details(String date,String time){
this.date=date;
this.time=time;
}
@Override
public boolean equals(Object obj){
if(this==obj){
return true;
}
if(obj==null|| getClass() != obj.getClass()){
return false;
}
Details ob = (Details) obj;
return this.date.equals(ob.date) && this.time.equals(ob.time);
}
@Override
public String toString(){
return this.date + " " + this.time;
}
class Appointment{
protected ArrayList<Details> list = new ArrayList<>();
int nm=3,ne=7;