Question No .1

1) ABC Meteorological Department is a scientific and a service department that provides daily updated weather data of different cities across country. It includes daily detailed temperature information. This information is accessed and used by different organizations like aviation and newspapers/websites .Similarly these facts and figures are used by different TV channels for regular weather forecast based on these facts. Every organization processes /sort data and present processed data in different formats. Which design pattern will be suitable that will notify updated data of meteorological department to all related departments (that have to use it for specified purposes).

Ans:-

Observer Pattern
Explanation:-

In the above paragraph we are describe that ABC Metrological Department is a science and a served department that provides daily update weather data of different cities across country. This paragraph shows the complete working of the ABC meteorological department.

2) A team of software engineers is working on a Project. Application will be supported on different platforms/operating systems. A GUI framework is required that will handle different application controls like buttons, text boxes and Edit Boxes. Programming multiple control types separately for different operating system is very difficult. We need a common configuration mechanism that will support individual instantiation for each control. Which design pattern will be suitable for mentioned scenario that will return specific/specialized controls?

Ans:-

Facade Pattern

Explanation:-

This paragraph show that a software engineer is working on a project. This paragraph show that this software accepted different application for different platform\operating system. It also tell us the that GUI required to control the different application like buttons, text boxes and Edit Boxes.

Question No. 2

Give code according to description. It should be of standard format according to coding conventions/style guidelines discussed.

SR No / Description / Standard Format
1 / Declare a variable for storage of teacher salary / int salary;
2 / Declare A private variable of class Patient to store appointment time / int time_;
3 / Declare a variable that will store number of item / int nItems;
4 / Declare/Name a function to calculate bill / int calculateBill ();
5 / Constant of float type to calculate Total Bill / float TOTAL_BILL;
6 / Variable to check weather status of a student is pass or fail in a course. / bool isPass;