[25 Marks]A user wants to book a flight through an online tr…
[25 Marks]A user wants to book a flight through an online travel agency. The process involves the following steps: The user searches for available flights by entering the destination, travel dates, and number of passengers. The system retrieves flight options from various airlines and displays them to the user. The user selects a flight and proceeds to book it. The user enters their personal and payment details. The system confirms the payment and books the flight. The system sends a booking confirmation and itinerary to the user. Task: Draw a sequence diagram to represent the interactions between the user, the system, and any relevant components (e.g., FlightSearchService, AirlineSystem, PaymentGateway). Show the flow of messages for searching flights, selecting a flight, entering payment details, and receiving a booking confirmation. [20 Marks]You are tasked with designing a Logger class that ensures only one instance of the logger is created during the lifetime of the application. The Logger class should allow writing log messages to a file. The class should include a method logMessage(String message) to write log messages. Task: Explain why the Singleton pattern is suitable for this problem. Draw a simple UML class diagram for the Logger class, implementing the Singleton pattern. Include any necessary methods and explain how the Singleton ensures only one instance is created. [25 Marks]You are designing a university management system, and the current implementation of the Professor class has several responsibilities: Acting as an advisor with methods like prepareGradApp(), verifyDegree(), and adviseCurriculum(). Acting as an instructor with methods like getLectureNotes() and getAssignment(). This design leads to low cohesion because the Professor class handles multiple unrelated tasks, making the system harder to maintain and modify. Task: Explain why the current Professor class design leads to low cohesion and how this impacts the maintainability of the system. Propose a solution to improve cohesion in the design. You can either: Split the Professor class into specialized subclasses, or Use interfaces to logically group responsibilities. Draw a class diagram showing your improved design, ensuring that you address cohesion and coupling issues. Be sure to illustrate the relationships between classes and/or interfaces (Advisor, Instructor, Professor) and show how students or the registrar’s office interact with them. [30 Marks]You are tasked with designing a data processing system that processes a stream of sensor data. The system should: Receive raw data from sensors (e.g., temperature, humidity). Filter out any invalid data (e.g., missing or erroneous values). Normalize the valid data to a standard format. Aggregate the normalized data to calculate the average values over a period of time. Output the processed data to a storage system. Task: Explain how you would apply the Pipes and Filter architecture to this system. Identify the key components (filters) involved in each step of the process and describe how data flows between these filters using pipes. Draw a simple diagram to illustrate how each filter processes the data and how the pipes connect the filters.
Read Details