Kapalı

Object Oriented Development Assignment 1

1. Objective:

a. To expose students to the Observer design pattern.

b. To sharpen students’ design skills in improving the Observer pattern to accept multiple Subjects.

2. List of software

NetBeans or NotePad++ with an installed JDK

3. Report and Marks

For each questions in this assignment, your report must include the following:

a. A UML class-diagram of your solution 40%

b. Source code of solution 40%

20 % will be given for a successful demonstration of your solution.

Due marks will be given for good coding styles (indents, capitalization, variable / method / class names, etc.).

Submit both a hardcopy and softcopy of your report.

This assignment is worth 10% of the overall marks for the course.

4. Due date

Part 5(a): 30/09/2014 (Tuesday), 5pm

Part 5(b): 02/10/2014 (Thursday), 5pm

5. Questions

Answer the following two questions. Mark distribution is as indicated at the end of each question.

a. Modify the ObserverExample source code to handle any number of Subject objects per Observer.

Use the following code for main(String[] args) :

public static void main(String[] args) {

PairOfNumbers numbers1=new PairOfNumbers();

PairOfNumbers numbers2=new PairOfNumbers();

SumObserver sum=new SumObserver(numbers1);

ProductObserver prod=new ProductObserver(numbers2);

MultiSubjectObserver m=new MultiSubjectObserver();

[url removed, login to view](numbers1);

[url removed, login to view](numbers2);

[url removed, login to view](20, 10);

[url removed, login to view](-10, 15);

}

Sample output:

New sum is: 30.0

MultiSubjectObserver activated with numbers: 20.0, 10.0

New product is: -150.0

MultiSubjectObserver activated with numbers: -10.0, 15.0

You are not allowed to change the following classes from the ObserverExample source code: Observer, Subject, PairOfNumbers, SumObserver, and ProductObserver.

(60 marks)

b. Based on the solution of 5(a), implement a WeatherObserver that would be able to track a TemperatureSensor, a PressureSensor, and a HumiditySensor.

Use the following code for main(String[] args) :

public static void main(String[] args) {

TemperatureSensor t = new TemperatureSensor();

PressureSensor p = new PressureSensor();

HumiditySensor h = new HumiditySensor();

WeatherObserver w = new WeatherObserver();

[url removed, login to view](t);

[url removed, login to view](p);

[url removed, login to view](h);

[url removed, login to view](28);

[url removed, login to view]("-------------------------------");

[url removed, login to view](200);

[url removed, login to view]("-------------------------------");

[url removed, login to view](89);

}

Sample output:

Temperature : 28 Celcius

Pressure : 0 Pascal

Humidity : 0 %

-------------------------------

Temperature : 28 Celcius

Pressure : 200 Pascal

Humidity : 0 %

-------------------------------

Temperature : 28 Celcius

Pressure : 200 Pascal

Humidity : 89 %

You are not allowed to change the following classes from 5(a): Observer and Subject.

(40 marks)

Beceriler: Java

Daha fazlasını görün: uml 1.2, string source code java, string pattern, software development coding, product design students, product design pattern, product design classes, pattern string, observer design pattern, objective c development, new product design and development, jdk design, java design pattern, design observer, c string pattern, assignment out source, Object Pascal, sample coding in java, uml and java code, product demonstration, object oriented, java assignment software, course development, design class diagram use, java course assignment

İşveren Hakkında:
( 0 değerlendirme ) Bukit Mertajam, Malaysia

Proje NO: #6507893

15 freelancer bu iş için ortalamada 88RM teklif veriyor

lovinagarwal21

I have 9+ years of exp in c c++ java j2ee hibernate spring webservices databases. Done multiple projects like this and almost proficient in design patterns..Checkout my completion rate and reviews.

1 gün içinde 97RM MYR
(39 Değerlendirme)
5.0
pivn

let expert do this...............................................................................................

1 gün içinde 106RM MYR
(13 Değerlendirme)
4.6
shain22

Dear Sir, We are having many development experience in Java and MySQL, We have experience in various technologies such as barcodes, RFID, FingerPrint Scanners, Touch Screens, Poll bars, Cash Drawers, Different Kind of Daha fazlası

in 2 gün içinde76RM MYR
(7 Değerlendirme)
4.6
quanlitysource

A proposal has not yet been provided

1 gün içinde 100RM MYR
(20 Değerlendirme)
4.0
dotharsh

Hi, Ping me if you are interested.... Thanks and regards, Harsh........................................................................................................................................................ Daha fazlası

1 gün içinde 82RM MYR
(24 Değerlendirme)
4.0
vikashtech1st

Hi there, I would like to work on your assignment. Please let me know for further discussion if interested.

1 gün içinde 50RM MYR
(11 Değerlendirme)
3.9
cungthehung

Hi. I did completed 100% project for my employers. I can do it for you with that price. Hope we have a deal. Thanks!

1 gün içinde 78RM MYR
(13 Değerlendirme)
3.6
Zark02

hello sir how are you i am a software engineering student and as you can see my profile i have a strong grip on java, c++ and .net and i can make this assignemnt very well, its a piece of cake for me... so come on ch Daha fazlası

1 gün içinde 80RM MYR
(4 Değerlendirme)
3.0
milan619

HI there, I have been working in Java since last 6 years and during my professional career I have done so many projects in Java. I have my small firm under which 7 people are working with me in java. If you are inte Daha fazlası

1 gün içinde 101RM MYR
(3 Değerlendirme)
3.0
NaveenNishaan

Dear Sir/Madam Let me take this opportunity to introduce myself as experience Java/J2ee Developer having 10+ years of experience of designing and developing various complex web and desktop specific application. I Daha fazlası

1 gün içinde 80RM MYR
(2 Değerlendirme)
2.7
rchandu12

I am currently working as software engineer in an MNC on Java/J2EE technologies. I can provide you the required software/ installation steps along with details mentioned in the requirement description. I have done the Daha fazlası

1 gün içinde 47RM MYR
(0 Değerlendirme)
0.0
bluewhaleindia

A proposal has not yet been provided

1 gün içinde 75RM MYR
(0 Değerlendirme)
0.0
tbarnabas

Hello, I am an expert in Java development and I have university level of degree. Please check my profile. I can help you. Don't hesitate you can contact me for details. Barnabas

1 gün içinde 222RM MYR
(0 Değerlendirme)
2.7
MashS10

A proposal has not yet been provided

in 4 gün içinde82RM MYR
(0 Değerlendirme)
0.0
yadavivek001

A proposal has not yet been provided

in 2 gün içinde87RM MYR
(0 Değerlendirme)
0.0
RehanZahoor

I am Oracle Certified Master, Java SE Developer and Oracle Certified Professional, Java SE Programmer. See my profile in Oracle's Masters at "[url removed, login to view]" I have exper Daha fazlası

1 gün içinde 32RM MYR
(0 Değerlendirme)
0.0