Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Consider the following scenario There is a Class called Scientific experiments that has a method called Analyse which accepts an array of integers as input

Consider the following scenario

There is a Class called Scientific experiments that has a method called Analyse which accepts an array of integers as input and returns their Accuracy of Integers, as output Now, an improved version of Scientific-experiments class called New Scientific-experiments has been released and Scientific-experiments has been withdrawn In this version, the 'Analyse method takes one more input parameter called Type of analysis it Type of analysis=1, the method returns Accuracy of integers if Type of analysis=2 then it returns the Precision of the experiments

a) Which Design Pattern will you sise to protect the calling programs from further changes to Scientific experiments class. We do not wish to change the calling programs.

b) Explain in detail why you have chosen to use this design pattern

c) Explain with me help of class dagram & pseudo code, the solution to protect the calling program from changes to 'Scientific experiments' Class

Step by Step Solution

There are 3 Steps involved in it

Step: 1

a The Design Pattern suitable for this situation would be the Adapter Pattern b The Adapter Pattern works as a bridge between two incompatible interfa... 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

Step: 3

blur-text-image

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

Building Java Programs A Back To Basics Approach

Authors: Stuart Reges, Marty Stepp

5th Edition

013547194X, 978-0135471944

More Books

Students also viewed these Programming questions

Question

2. What is the authorised share capital of Landy Suppliers Ltd?

Answered: 1 week ago

Question

sieve of eratosthenes 2 to 36 solve it like an algorithm and code

Answered: 1 week ago

Question

What is the difference between adsorption and absorption?

Answered: 1 week ago