Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

describe both a high-level and a mid-level model of your answer to part (d) where the mid-level model requires minimal or no modification to the


describe both a high-level and a mid-level model of your answer to part (d) where the mid-level model requires minimal or no modification to the device driver firmware but is not a net-level model and where the high-level model dispenses with much of the device driver code and many or all of the interrupts. [3 marks each] 10 CST.2011.9.11 11 Temporal Logic and Model Checking (a) Explain the difference between static and dynamic methods for property checking. Is LTL or CTL a better property language for dynamic checking? Justify your answer. [4 marks] (b) Outline an algorithm for model checking LTL properties of the form G p, where p is an atomic property. [4 marks] (c) What is the difference between explicit state and symbolic model checking? [4 marks] (d) Who is the person credited with introducing temporal logic as a property specification language? What were the main contributions of Clarke & Emerson, and of McMillan, to model checking? Why were they significant? [4 marks] (e) Briefly explain the terms Boolean layer, Temporal layer, Verification layer and Modelling layer in connection with PSL. [4 marks] 12 Topical Issues (a) Describe the Binary Exponential Backoff (BEB) procedure found in 802.11 (WiFi) and explain why it is necessary. Give two shortcomings of the BEB approach. [4 marks] (b) Describe two modifications to the BEB algorithm that could be made by a malicious user attempting to increase their chances of gaining access to the wireless channel. At least one of your modifications, if used by all wireless stations, should enable the provision of Qurocedure in heavily congested networks. Propose an alternative procedure, which may be based on BEB, that has improved behaviour in such networks. Take care to explain how it outperforms the default technique. Discuss how your solution behaves in lightly congested networks.


Now try to call the checkAnswer(response) method of r q1 object. Design this just after have read the response from the child playing the game. Ah, will have to implement the checkAnswer method inside Question class before can call it! I suggest that make that method responsible for checking the response against the correct answer, and also printing either a message to congratulate them on geee what it does. should be able to remove even more code from r main method now, since all the answer checking is done inside the Question.checkAnswer method.

(a) Define what is meant by a class, an abstract class, an interface and a final class in Java. [4] (b) How many times will the for loop in the following code execute? [3] for (int i=Integer.MAX_VALUE-17; i<=Integer.MAX_VALUE; i++) { ... } (c) What is a design pattern? [2] (d) What is the goal of the Decorator pattern? Draw a UML diagram that demonstrates the pattern, and give an example of its use. [6] (e) A developer suggests that both the Decorator and the Proxy design patterns are about providing indirect access to objects through an intermediary and that they should be considered as one pattern. Comment on this. [5]

2. A computer game allow players to try their hand at managing a virtual football team. The program is structured as shown in the UML class diagram below (not all member functions and variables are shown for clarity): (a) Give three differences between an abstract class and an interface in Java. Which would you expect Footballer to be and why? [5] (b) Consider the design of Footballer and its classes. Why is this design inappropriate? [3] (c) Suggest a design pattern that would be more appropriate to apply to Footballer. Sketch the resultant UML class diagram. [4] (d) The ManagementGame must store the collection of teams, sorted alphabetically by team name. Suggest how you wou using the Java class library and without implementing any extra interfaces. [3] (e) The ManagementGame must also store the teams ordered by their score, highest first. Teams with the same score should appear in alphabetical order. Describe how you would achieve this. You may now use an appropriate interface from the library if you wish. [5]

3. (a) What is the decimal number 63 in binary (base-2), hexadecimal (base-16), and base-17? [4] (b) What will be produced by this code: [3] int i=-1; for (int j=0; j<3; j++) { i = i >>> 2; i |= (1<<31); i = i << 2; } System.out.println(i); (c) Explain the difference between a shallow copy and a deep copy of an object, giving examples in Java where appropriate. [4] (d) Comment on the implementation of the following class. Assume that a deep copy is required. Provide corrections for any problems or design faults that you describe. [9] import java.util.LinkedList; public class MyClass extends OtherClass implements Cloneable { public int[] intArray = new int[100]; public LinkedList list = null; public Object clone() throws CloneNotSupportedException { MyClass m = new MyClass(); m.intArray = intArray; m.list = list; return m;

(a) Explain what is understood by static and dynamic scope in the context of programming languages. Write program fragment in pseudocode such that its execution under static scoping and under dynamic scoping yields different outcomes. Justify your answer. [7 marks] (b) The type system of the programming language Pascal has a rich set of datastructuring concepts, including variant records. Recall that variant records have a part common to all records of the type and a variable part (discriminated via an optional tag field) specific to some subset of records. For instance, consider the variant-record type UBtree of unary/binary branching trees below: type kind = (unary,binary) ; type UBtree

imageimage

Create a class printdata which has methods to print different types of data using the concept of overloading. Void printval(int) Void printval(float[]) Void printval(String[) Create a class Test to read option and array size n If option=1 then get integer array input and print the odd index value If option=2 then get float array input and print the even index sorted array If option=3 then get String array input and print the array

Step by Step Solution

There are 3 Steps involved in it

Step: 1

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_2

Step: 3

blur-text-image_3

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

Applied Regression Analysis And Other Multivariable Methods

Authors: David G. Kleinbaum, Lawrence L. Kupper, Azhar Nizam, Eli S. Rosenberg

5th Edition

1285051084, 978-1285963754, 128596375X, 978-1285051086

More Books

Students also viewed these Computer Network questions