Answered step by step
Verified Expert Solution
Question
1 Approved Answer
in a C# please and make sure it works thank you so much The Observer Design Pattern is a Software Design Pattern in which an
in a C# please and make sure it works thank you so much
The Observer Design Pattern is a Software Design Pattern in which an object (called as Subject) maintains a list of its dependents (called as Observers) and notifies them automatically when a given state changes by calling one of their methods. Complete the console app that solve the following problem with Observer design pattern: Three customers come to a Car Dealership for buying a Car. Unfortunately, at that time the Car is out of stock. At the dealership, the customers are registered to be notified when the car is available. Customers are registered with a maximum acceptable price of the car. So, when the car will be available, the dealership will send a notification to them. When the car is available, the quantity in stock changes, the dealership sends notifications to all the customers who are registered and are willing to accept the current price of the car. Question 2 console app is partially implemented. So, you task is: In the Car.cs class: - Set a new price and call NotifyObservers(). (1 marks) - Add a customer to the waiting List. (1 marks) - Remove a customer from the waiting List. (1 marks) - Notify each customer if the qty is greater than zero. (2 marks) - Remove the customer from the waiting list once notifying them. Use RemoveObserver(). (2 marks) In the Customer.cs class: - Assign the respective values and register this observer to the car. Use RegisterObserver(). (1 marks) - Notify the customer. Use Console.WriteLine(). (1 marks) Note: 1 mark for clarity of the codeStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started