Mini Project - JS & TS - Enhanced Event Management System #154
Replies: 12 comments
-
interface Person {
id: number;
name: string;
email: string;
}
interface Event {
id: number;
name: string;
location: string;
date: Date;
organizer: Organizer;
attendees: Person[];
addAttendee(attendee: Person): void;
removeAttendee(attendeeId: number): void;
}
class Organizer implements Person {
id: number;
name: string;
email: string;
events: Event[];
constructor(event: Event[] = []) {
this.events = event;
}
createEvent = (event: Event): void => {
this.events.push(event);
};
}
class User implements Person {
id: number;
name: string;
email: string;
rsvps: Event[];
constructor(rsvp: Event[] = []) {
this.rsvps = rsvp;
}
rsvp = (event: Event): void => {
this.rsvps.push(event);
};
cancelRsvp = (eventId: number): void => {
const index = this.rsvps.findIndex((event) => event.id === eventId);
this.rsvps.splice(index, 1);
};
}
class EventManagement {
events: Event[];
attendees: Person[];
constructor(events: Event[] = [], attendees: Person[] = []) {
this.events = events;
this.attendees = attendees;
}
addAttendee = (attendee: Person): void => {
this.attendees.push(attendee);
};
removeAttendee = (attendeeId: number): void => {
this.attendees = this.attendees.filter(
(attendee) => attendee.id === attendeeId
);
};
addEvent = (event: Event): void => {
this.events.push(event);
};
removeEvent = (eventId: number): void => {
this.events = this.events.filter((event) => event.id === eventId);
};
filterEventsByLocation = (location: string): Event[] => {
return this.events.filter((event) => event.location === location);
};
filterEventsByDate = (date: Date): Event[] => {
return this.events.filter((event) => event.date === date);
};
sendNotifications = (eventId: number, message: string): void => {
const attendees = this.events.find(
(event) => event.id === eventId
)?.attendees;
attendees?.forEach((attendee) => {
// send notification through email
});
};
} |
Beta Was this translation helpful? Give feedback.
-
|
interface Person { interface Event { class Organizer implements Person { constructor(event: Event[] = []) { createEvent = (event: Event): void => { class User implements Person { constructor(rsvp: Event[] = []) { rsvp = (event: Event): void => { cancelRsvp = (eventId: number): void => { class EventManagement { constructor(events: Event[] = [], attendees: Person[] = []) { addAttendee = (attendee: Person): void => { removeAttendee = (attendeeId: number): void => { addEvent = (event: Event): void => { removeEvent = (eventId: number): void => { filterEventsByLocation = (location: string): Event[] => { filterEventsByDate = (date: Date): Event[] => { sendNotifications = (eventId: number, message: string): void => { |
Beta Was this translation helpful? Give feedback.
-
CODEimport { log } from "console";
interface Person {
id: number;
name: string;
email: string;
}
class Organizer implements Person {
id: number;
name: string;
email: string;
events: Event[];
constructor(id: number, name: string, email: string) {
this.id = id;
this.name = name;
this.email = email;
this.events = [];
}
createEvent(event: Event): void {
this.events.push(event);
}
}
interface Event {
id: number;
name: string;
location: string;
date: Date;
organizer: Organizer;
attendees: Person[];
addAttendee(attendee: Person): void;
removeAttendee(attendeeId: number): void;
}
class User implements Person {
id: number;
name: string;
email: string;
rsvps: Event[];
constructor(id: number, name: string, email: string) {
this.id = id;
this.name = name;
this.email = email;
this.rsvps = [];
}
rsvp(event: Event): void {
event.addAttendee(this);
this.rsvps.push(event);
}
cancelRsvp(eventId: number): void {
const eventIndex = this.rsvps.findIndex((event) => event.id === eventId);
if (eventIndex !== -1) {
const event = this.rsvps[eventIndex];
event.removeAttendee(this.id);
this.rsvps.splice(eventIndex, 1);
}
}
}
class EventManagement{
events: Event[];
constructor() {
this.events = [];
}
addEvent(event: Event): void {
this.events.push(event);
}
removeEvent(eventId: number): void {
const eventIndex = this.events.findIndex((event) => event.id === eventId);
if (eventIndex !== -1) {
this.events.splice(eventIndex, 1);
}
}
filterEventsByLocation(location: string): Event[] {
return this.events.filter((event) => event.location === location);
}
filterEventsByDate(date: Date): Event[] {
return this.events.filter((event) => event.date.getTime() === date.getTime());
}
sendNotifications(eventId: number, message: string): void {
const event = this.events.find((event) => event.id === eventId);
if (event) {
event.attendees.forEach((attendee) => {
console.log(`Sending notification to ${attendee.name} (${attendee.email}): ${message}`);
});
}
}
}
class SimpleEvent implements Event {
id: number;
name: string;
location: string;
date: Date;
organizer: Organizer;
attendees: Person[];
constructor(id: number, name: string, location: string, date: Date, organizer: Organizer) {
this.id = id;
this.name = name;
this.location = location;
this.date = date;
this.organizer = organizer;
this.attendees = [];
}
bubbles: boolean;
cancelBubble: boolean;
cancelable: boolean;
composed: boolean;
currentTarget: EventTarget | null;
defaultPrevented: boolean;
eventPhase: number;
isTrusted: boolean;
returnValue: boolean;
srcElement: EventTarget | null;
target: EventTarget | null;
timeStamp: number;
type: string;
composedPath(): EventTarget[] {
throw new Error("Method not implemented.");
}
initEvent(type: string, bubbles?: boolean | undefined, cancelable?: boolean | undefined): void {
throw new Error("Method not implemented.");
}
preventDefault(): void {
throw new Error("Method not implemented.");
}
stopImmediatePropagation(): void {
throw new Error("Method not implemented.");
}
stopPropagation(): void {
throw new Error("Method not implemented.");
}
NONE: 0;
CAPTURING_PHASE: 1;
AT_TARGET: 2;
BUBBLING_PHASE: 3;
addAttendee(attendee: Person): void {
this.attendees.push(attendee);
}
removeAttendee(attendeeId: number): void {
const attendeeIndex = this.attendees.findIndex((attendee) => attendee.id === attendeeId);
if (attendeeIndex !== -1) {
this.attendees.splice(attendeeIndex, 1);
}
}
}
const organizer2 = new Organizer(1, "Alice", "alice@example.com");
const organizer3 = new Organizer(2, "Bob", "bob@example.com");
const user5 = new User(3, "Charlie", "charlie@example.com");
const user6 = new User(4, "Dave", "dave@example.com");
const event6 = new SimpleEvent(5, "Event 1", "Location 1", new Date("2023-05-10"), organizer2);
const event7 = new SimpleEvent(6, "Event 2", "Location 2", new Date("2023-05-12"), organizer3);
const eventManagement1 = new EventManagement();
eventManagement1.addEvent(event6);
eventManagement1.addEvent(event7);
user5.rsvp(event6);
user6.rsvp(event7);
user5.cancelRsvp(event6.id);
const eventsInLocation2 = eventManagement1.filterEventsByLocation("Location 2");
const eventsOnMay12 = eventManagement1.filterEventsByDate(new Date("2023-05-12"));
eventManagement1.sendNotifications(event6.id, "Reminder: Event 2 is coming up!");
const person: Person = {
id: 1,
name: 'Samir kumar',
email: 'sam2elect@gmail.com'
};
console.log(person);
const organizer: Organizer = {
id: 2,
name: 'Atul sindhu',
email: 'atul@gmail.com',
createEvent: (event: Event) => console.log(`${event.name} event created by ${organizer.name}.`),
events: []
};
const event1: Event = {
id: 1,
name: 'Music Fest',
location: 'Cubbon Park',
date: new Date('2023-07-08'),
organizer: organizer,
attendees: [],
bubbles: false,
cancelBubble: false,
cancelable: false,
composed: false,
currentTarget: null,
defaultPrevented: false,
eventPhase: 0,
isTrusted: false,
returnValue: false,
srcElement: null,
target: null,
timeStamp: 0,
type: "",
composedPath: function (): EventTarget[] {
throw new Error("Function not implemented.");
},
initEvent: function (type: string, bubbles?: boolean | undefined, cancelable?: boolean | undefined): void {
throw new Error("Function not implemented.");
},
preventDefault: function (): void {
throw new Error("Function not implemented.");
},
stopImmediatePropagation: function (): void {
throw new Error("Function not implemented.");
},
stopPropagation: function (): void {
throw new Error("Function not implemented.");
},
NONE: 0,
CAPTURING_PHASE: 1,
AT_TARGET: 2,
BUBBLING_PHASE: 3,
addAttendee: function (attendee: Person): void {
throw new Error("Function not implemented.");
},
removeAttendee: function (attendeeId: number): void {
throw new Error("Function not implemented.");
}
};
organizer.createEvent(event1);
console.log(event1);
const event2: Event = {
id: 1,
name: 'Dinner',
location: 'Salt lake',
date: new Date('2023-07-08'),
organizer: {
id: 2,
name: 'Atul sindhu',
email: 'atul@gmail.com',
createEvent: () => { },
events: []
},
attendees: [],
bubbles: false,
cancelBubble: false,
cancelable: false,
composed: false,
currentTarget: null,
defaultPrevented: false,
eventPhase: 0,
isTrusted: false,
returnValue: false,
srcElement: null,
target: null,
timeStamp: 0,
type: "",
composedPath: function (): EventTarget[] {
throw new Error("Function not implemented.");
},
initEvent: function (type: string, bubbles?: boolean | undefined, cancelable?: boolean | undefined): void {
throw new Error("Function not implemented.");
},
preventDefault: function (): void {
throw new Error("Function not implemented.");
},
stopImmediatePropagation: function (): void {
throw new Error("Function not implemented.");
},
stopPropagation: function (): void {
throw new Error("Function not implemented.");
},
NONE: 0,
CAPTURING_PHASE: 1,
AT_TARGET: 2,
BUBBLING_PHASE: 3,
addAttendee: function (attendee: Person): void {
throw new Error("Function not implemented.");
},
removeAttendee: function (attendeeId: number): void {
throw new Error("Function not implemented.");
}
};
console.log(event2);
const user1: User = {
id: 3,
name: 'Suraj dayal',
email: 'suraj@gmail.com',
rsvp: (event: Event) => console.log(`${user1.name} RSVP'd for ${event.name} event.`),
cancelRsvp: (eventId: number) => console.log(`${user1.name} cancelled RSVP for event with ID ${eventId}.`),
rsvps: []
};
const event3: Event = {
id: 1,
name: 'Cricket',
location: 'Chinna swami stadium',
date: new Date('2023-07-08'),
organizer: {
id: 2,
name: 'Harsh Kumar',
email: 'harsh@gmail.com',
createEvent: () => { },
events: []
},
attendees: [],
bubbles: false,
cancelBubble: false,
cancelable: false,
composed: false,
currentTarget: null,
defaultPrevented: false,
eventPhase: 0,
isTrusted: false,
returnValue: false,
srcElement: null,
target: null,
timeStamp: 0,
type: "",
composedPath: function (): EventTarget[] {
throw new Error("Function not implemented.");
},
initEvent: function (type: string, bubbles?: boolean | undefined, cancelable?: boolean | undefined): void {
throw new Error("Function not implemented.");
},
preventDefault: function (): void {
throw new Error("Function not implemented.");
},
stopImmediatePropagation: function (): void {
throw new Error("Function not implemented.");
},
stopPropagation: function (): void {
throw new Error("Function not implemented.");
},
NONE: 0,
CAPTURING_PHASE: 1,
AT_TARGET: 2,
BUBBLING_PHASE: 3,
addAttendee: function (attendee: Person): void {
throw new Error("Function not implemented.");
},
removeAttendee: function (attendeeId: number): void {
throw new Error("Function not implemented.");
}
};
user1.rsvp(event3);
user1.cancelRsvp(event3.id);
console.log(event3);
const eventManagement = new EventManagement();
const organizer1: Organizer = {
id: 2,
name: 'Ravi kumar',
email: 'ravi@gmail.com',
createEvent: (event: Event) => eventManagement.addEvent(event),
events: []
};
const event4: Event = {
id: 1,
name: 'College reunion',
location: 'Ramaiah',
date: new Date('2023-07-08'),
organizer: organizer,
attendees: [],
addAttendee: function (attendee: Person): void {
throw new Error("Function not implemented.");
},
removeAttendee: function (attendeeId: number): void {
throw new Error("Function not implemented.");
}
};
const event5: Event = {
id: 2,
name: 'Tech Conference',
location: 'Convention Center',
date: new Date("2023"),
organizer1: undefined,
attendees: [],
addAttendee: function (attendee: Person): void {
throw new Error("Function not implemented.");
},
removeAttendee: function (attendeeId: number): void {
throw new Error("Function not implemented.");
}
}
console.log(event4);
console.log(event5);
OUTPUT |
Beta Was this translation helpful? Give feedback.
-
|
interface Person { interface Event { class Organizer implements Person { constructor(event: Event[] = []) { createEvent = (event: Event): void => { class User implements Person { constructor(rsvp: Event[] = []) { rsvp = (event: Event): void => { cancelRsvp = (eventId: number): void => { class EventManagement { constructor(events: Event[] = [], attendees: Person[] = []) { addAttendee = (attendee: Person): void => { removeAttendee = (attendeeId: number): void => { addEvent = (event: Event): void => { removeEvent = (eventId: number): void => { filterEventsByLocation = (location: string): Event[] => { filterEventsByDate = (date: Date): Event[] => { sendNotifications = (eventId: number, message: string): void => { |
Beta Was this translation helpful? Give feedback.
-
interface Person{
id: number;
name: string;
email: string ;
}
class Organizer implements Person{
events: Event[] = [];
id: number;
name: string;
email: string ;
constructor(id: number,name: string,email: string){
this.id=id;
this.name=name;
this.email=email;
}
createEvent(event: Event): void{
this.events.push(event);
}
}
interface Event{
id: number;
name: string;
location: string;
date: Date;
organizer: Organizer;
attendees: Person[];
addAttendee(attendee: Person): void;
removeAttendee(attendeeId: number): void;
}
class User implements Person{
id: number;
name: string;
email: string ;
rsvps: Event[];
constructor(id: number,name: string,email: string){
this.id=id;
this.name=name;
this.email=email;
}
rsvp(event: Event): void {
this.rsvps.push(event);
}
cancelRsvp(eventId: number): void{
const index = this.rsvps.findIndex((event) => event.id === eventId);
this.rsvps.splice(index, 1);
}
}
class EventManagement{
events: Event[];
attendees: Person[];
addEvent(event: Event): void{
this.events.push(event);
}
addAttendee = (attendee: Person): void => {
this.attendees.push(attendee);
};
removeAttendee = (attendeeId: number): void => {
this.attendees = this.attendees.filter(
(attendee) => attendee.id === attendeeId
);
};
removeEvent(eventId: number): void{
this.events = this.events.filter((event) => event.id === eventId);
}
filterEventsByLocation(location: string): Event[]{
return this.events.filter((event) => event.location === location);
}
filterEventsByDate(date: Date): Event[]{
return this.events.filter((event) => event.date === date);
}
sendNotifications(eventId: number, message: string): void{
const attendees = this.events.find(
(event) => event.id === eventId
)?.attendees;
attendees?.forEach((attendee) => {
// notification email
});
};
}
} |
Beta Was this translation helpful? Give feedback.
-
interface Person {
id: number;
name: string;
email: string;
}
class Organizer implements Person {
constructor(public id: number, public name: string, public email: string) {}
createEvent(event: Event): void {
// code to create a new event
}
}
interface Event {
id: number;
name: string;
location: string;
date: Date;
organizer: Organizer;
attendees: Person[];
addAttendee(attendee: Person): void;
removeAttendee(attendeeId: number): void;
}
class User implements Person {
constructor(public id: number, public name: string, public email: string) {}
rsvp(event: Event): void {
// code to RSVP for an event
}
cancelRsvp(eventId: number): void {
// code to cancel an RSVP for an event by its ID
}
}
class EventManagement {
private events: Event[] = [];
addEvent(event: Event): void {
this.events.push(event);
}
removeEvent(eventId: number): void {
const index = this.events.findIndex((event) => event.id === eventId);
if (index !== -1) {
this.events.splice(index, 1);
}
}
filterEventsByLocation(location: string): Event[] {
return this.events.filter((event) => event.location === location);
}
filterEventsByDate(date: Date): Event[] {
return this.events.filter((event) => event.date.getTime() === date.getTime());
}
sendNotifications(eventId: number, message: string): void {
const event = this.events.find((event) => event.id === eventId);
if (event) {
event.attendees.forEach((attendee) => {
// code to send notification to attendee with message
});
}
}
}
// Example usage:
const organizer = new Organizer(1, 'John Doe', 'johndoe@example.com');
const event = {
id: 1,
name: 'My Event',
location: 'New York',
date: new Date('2023-06-01'),
organizer,
attendees: [],
addAttendee(attendee: Person) {
this.attendees.push(attendee);
},
removeAttendee(attendeeId: number) {
const index = this.attendees.findIndex((attendee) => attendee.id === attendeeId);
if (index !== -1) {
this.attendees.splice(index, 1);
}
},
};
const user = new User(2, 'Jane Smith', 'janesmith@example.com');
const eventManagement = new EventManagement();
eventManagement.addEvent(event);
event.addAttendee(user);
console.log(event.attendees); // output: [{id: 2, name: 'Jane Smith', email: 'janesmith@example.com'}] |
Beta Was this translation helpful? Give feedback.
-
interface Person{
id:number;
name:string;
email:string;
}
interface Event{
id: number;
name: string;
location: string;
date: Date;
organizer: Organizer;
attendees: Person[];
addAttendee(attendee: Person): void;
removeAttendee(attendeeId: number): void;
}
class Organizer implements Person{
id:number;
name:string;
email:string;
events:string;
constructor(id:number, name:string, email:string , events:Event[]){
this.id=id;
this.name=name;
this.email=email;
this.events=Event[];
}
createEvent = (event: Event[]): void => {
//create a new event
this.events.push(event);
};
}
class user implements Person{
id:number;
name:string;
email:string;
rsvp:Event[];
constructor(id:number, name:string, email:string, rsvp:Event[]){
this.id = id;
this.name=name;
this.email=email;
this.rsvp = rsvp;
}
rsvp = (event: Event[]): void => {
this.rsvps.push(event);
};
cancelRsvp = (eventId: number): void => {
const index = this.rsvps.findIndex((event) => event.id === eventId);
this.rsvps.splice(index, 1);
};
}
Class EventManagement{
events:Event[];
attendees:Event[];
constructor(events: Event[] = [], attendees: Person[] = []) {
this.events = events;
this.attendees = attendees;
}
addAttendee = (attendee: Person): void => {
this.attendees.push(attendee);
};
removeAttendee = (attendeeId: number): void => {
this.attendees = this.attendees.filter(
(attendee) => attendee.id === attendeeId
);
};
addEvent = (event: Event): void => {
this.events.push(event);
};
removeEvent = (eventId: number): void => {
this.events = this.events.filter((event) => event.id === eventId);
};
filterEventsByLocation = (location: string): Event[] => {
return this.events.filter((event) => event.location === location);
};
filterEventsByDate = (date: Date): Event[] => {
return this.events.filter((event) => event.date === date);
};
sendNotifications = (eventId: number, message: string): void => {
const attendees = this.events.find(
(event) => event.id === eventId
)?.attendees;
attendees?.forEach((attendee) => {
});
};
} |
Beta Was this translation helpful? Give feedback.
-
|
interface Person { interface Event { class Organizer implements Person { constructor(event: Event[] = []) { createEvent = (event: Event): void => { class User implements Person { constructor(rsvp: Event[] = []) { rsvp = (event: Event): void => { cancelRsvp = (eventId: number): void => { class EventManagement { constructor(events: Event[] = [], attendees: Person[] = []) { addAttendee = (attendee: Person): void => { removeAttendee = (attendeeId: number): void => { addEvent = (event: Event): void => { removeEvent = (eventId: number): void => { filterEventsByLocation = (location: string): Event[] => { filterEventsByDate = (date: Date): Event[] => { sendNotifications = (eventId: number, message: string): void => { |
Beta Was this translation helpful? Give feedback.
-
// Task: Event Management System
// You have been asked to develop an event management system that allows you to
//manage events, attendees, and event organizers.
//The system should let you add events and their organizers, filter events by location or date,
// let users RSVP for events, and send notifications to event attendees.
// Create the following interfaces and classes using TypeScript:
// Interface Person with the following properties:
// id: number - A unique identifier for the person.
// name: string - The name of the person.
// email: string - The email of the person.
// Class Organizer that implements the Person interface and has the following method:
// createEvent(event: Event): void - A method to create a new event.
interface Person{
id: number;
name: string;
email: string;
}
// Interface Event with the following properties and methods:
// id: number - A unique identifier for the event.
// name: string - The name of the event.
// location: string - The location of the event.
// date: Date - The date of the event.
// organizer: Organizer - The organizer of the event.
// attendees: Person[] - An array of attendees for the event.
// addAttendee(attendee: Person): void - A method to add an attendee to the event.
// removeAttendee(attendeeId: number): void - A method to remove an attendee from the event by their ID.
interface Event{
id: number;
name: string;
location: string;
date: Date;
organizer: Organizer;
attendees: Person[];
addAttendee(attendee: Person): void;
removeAttendee(attendeeId: number): void;
}
class Organizer implements Person {
id: number;
name: string;
email: string;
events:Event[];
constructor(id:number,name:string,email:string,event:Event[]=[])
{
this.id = id;
this.name = name;
this.email = email;
this.events = event;
}
createEvent=(event: Event): void=>
{
this.events.push(event);
}
}
class UserEL implements Person {
id: number;
name: string;
email: string;
rsvps:Event[];
constructor(id:number,name:string,email:string,rsvps:Event[]=[])
{
this.id = id;
this.name = name;
this.email = email;
this.rsvps=rsvps;
}
rsvp=(event: Event): void => //- A method to RSVP for an event.
{
this.rsvps.push(event);
}
cancelRsvp=(eventId: number): void => // - A method to cancel an RSVP for an event by its ID.
{
const index = this.rsvps.findIndex(event => event.id === eventId);
if (index !== -1) {
this.rsvps.splice(index, 1);
}
}
}
// Class EventManagement with the following methods:
// addEvent(event: Event): void - A method to add an event to the event management system.
// removeEvent(eventId: number): void - A method to remove an event from the event management system by its ID.
// filterEventsByLocation(location: string): Event[] - A method to filter events by location.
// filterEventsByDate(date: Date): Event[] - A method to filter events by date.
// sendNotifications(eventId: number, message: string): void - A method to send notifications to all attendees of an event by its ID.
class EventManagement{
events:Event[];
attendees:Person[];
constructor( events:Event[], attendees:Person[]){
this.events = events;
this.attendees=attendees;
}
addAttendee=(attendee: Person): void =>
{
this.attendees.push(attendee);
}
removeAttendee=(attendeeId: number): void => {
const index = this.attendees.findIndex(attendees => attendees.id === attendeeId);
if (index !== -1) {
this.attendees.splice(index, 1);
}
}
addEvent=(event: Event): void =>
{
this.events.push(event);
}
removeEvent=(eventId: number): void =>
{
const index = this.events.findIndex(event => event.id === eventId);
if (index !== -1) {
this.events.splice(index, 1);
}
}
filterEventsByLocation=(location: string): Event[] =>
{
return this.events.filter(event => event.location === location);
}
filterEventsByDate=(date: Date): Event[]=>
{
return this.events.filter(event => event.date.getTime() === date.getTime());
}
sendNotifications=(eventId: number, message: string): void=>
{
}
} |
Beta Was this translation helpful? Give feedback.
-
|
interface Person{ class Organizer implements Person{ } interface Event { } class UserNew implements Person { } } |
Beta Was this translation helpful? Give feedback.
-
|
interface Person{ class Organizer implements Person{ } interface Event{ class User implements Person{ } class EventManagement{ } |
Beta Was this translation helpful? Give feedback.
-
|
interface Person { class Organizer implements Person { } interface Event { class User implements Person { } class EventManagement { } |
Beta Was this translation helpful? Give feedback.






Uh oh!
There was an error while loading. Please reload this page.
-
Task: Event Management System
You have been asked to develop an event management system that allows you to manage events, attendees, and event organizers. The system should let you add events and their organizers, filter events by location or date, let users RSVP for events, and send notifications to event attendees.
Create the following interfaces and classes using TypeScript:
Interface
Personwith the following properties:id: number - A unique identifier for the person.name: string - The name of the person.email: string - The email of the person.Class
Organizerthat implements thePersoninterface and has the following method:createEvent(event: Event): void - A method to create a new event.Interface
Eventwith the following properties and methods:id: number - A unique identifier for the event.name: string - The name of the event.location: string - The location of the event.date: Date - The date of the event.organizer: Organizer - The organizer of the event.attendees: Person[] - An array of attendees for the event.addAttendee(attendee: Person): void - A method to add an attendee to the event.removeAttendee(attendeeId: number): void - A method to remove an attendee from the event by their ID.Class
Userthat implements thePersoninterface and has the following methods:rsvp(event: Event): void - A method to RSVP for an event.cancelRsvp(eventId: number): void - A method to cancel an RSVP for an event by its ID.Class
EventManagementwith the following methods:addEvent(event: Event): void - A method to add an event to the event management system.removeEvent(eventId: number): void - A method to remove an event from the event management system by its ID.filterEventsByLocation(location: string): Event[] - A method to filter events by location.filterEventsByDate(date: Date): Event[] - A method to filter events by date.sendNotifications(eventId: number, message: string): void - A method to send notifications to all attendees of an event by its ID.Make use of arrow functions, classes, interfaces, and array methods such as
push,find,filter, andsplicein the implementation. This task requires a combination of logic and creativity, as it involves managing events, attendees, and organizers in an event management system. The classes and interfaces represent different aspects of the event management system, and you will need to implement methods to add and remove events and attendees, filter events, handle RSVPs, and send notifications to attendees.Beta Was this translation helpful? Give feedback.
All reactions