CS504 Assignment 3
#1
CS504 Assignment 3
Spring 2017

Question No .1
Design patterns are programming language independenstrategies for solving the common object-oriented design problems. A design pattern isn't a finished design that can be transformed directly into code.It is a  description or  template  for  how  to  solve a  problem that can be used in many different situations. Consider given scenarios:



  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  alrelated departments (that have to use it for specified purposes). 
  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? 
Name design pattern for each scenario and also explain reason.


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

  1. Declare a  variable for storage of teacher salary 
  2. Declare A private variable of class Patient to store appointment time 
  3. Declare a variable that will store number of items  
  4. Declare/Name a  function to calculate bill 
  5. Constant of float type to calculate Total Bill 
  6. Variable to check weather status of a student is pass or fail in a course. 
#2
Question No. 1
Solution:
1. Observer Pattern
2. Facade Pattern
#3
Any suggestions for Question 2 solution @Pakistani ?
#4
(07-16-2017, 05:46 PM)Rana Wrote: Any suggestions for Question 2 solution @Pakistani ?

Question 2 Answers:
1. int salary;
2. int time_;
3. int nItems;
4. int calculateBill ();
5. float TOTAL_BILL;
6. bool isPass;
#5
Information 
(07-15-2017, 07:04 PM)Pakistani Wrote: Question No. 1
Solution:
1. Observer Pattern
2. Facade Pattern
(  Name design pattern for each scenario and also explain reason) plz explain the reason
#6
Reasons are pretty straight forward, because these two design patterns fit the given scenarios.
Its best to write the reasons in your own words, so no one copies another student and lose marks.
#7
(07-15-2017, 07:04 PM)Pakistani Wrote: Question No. 1
Solution:
1. Observer Pattern
2. Facade Pattern

bhai is ko explain karna ha jo ap ny likha ha plz correct kar k dain
#8
(07-18-2017, 08:30 PM)Shahzad_vehari@yahoo.com Wrote:
(07-15-2017, 07:04 PM)Pakistani Wrote: Question No. 1
Solution:
1. Observer Pattern
2. Facade Pattern

bhai is ko explain karna ha jo ap ny likha ha plz correct kar k dain

Bhai read the examples for Observer and Facade design patterns in lecture 27 from handouts. You'll understand that these fit the given scenarios.
  


Possibly Related Threads...
Thread Author Replies Views Last Post
  CS504 GDB Admin 2 273 08-02-2017, 10:15 AM
Last Post: jamshed Ansari
  CS504 Quiz 2 Screenshots Pakistani 0 160 07-27-2017, 06:42 PM
Last Post: Pakistani
  cs504 assignment 1 help needed Syed Muhammad Taha 3 498 05-10-2017, 04:44 PM
Last Post: Admin
  CS504 All Current Final Term Papers 20 August 2016 to 02 September 2016 Rubaisha(Moody Girl) 0 585 08-20-2016, 07:34 PM
Last Post: Rubaisha(Moody Girl)
  cs504 all current midterm papers 2016 Rubaisha(Moody Girl) 0 651 06-04-2016, 05:51 PM
Last Post: Rubaisha(Moody Girl)
  Cs504 assignment solution idea Rubaisha(Moody Girl) 1 1,628 05-12-2016, 12:41 PM
Last Post: Hunain khan



Users browsing this thread:
1 Guest(s)