Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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 code

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

JDBC Database Programming With J2ee

Authors: Art Taylor

1st Edition

0130453234, 978-0130453235

More Books

Students also viewed these Databases questions

Question

25.0 m C B A 52.0 m 65.0 m

Answered: 1 week ago

Question

3. Describe the strategic training and development process.

Answered: 1 week ago

Question

10. Microsoft Corporation

Answered: 1 week ago