Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVA PROGRAMMING Instruction: Although each of these techniques can provide new information of value to a software project, costs can be reduced if information is

JAVA PROGRAMMING

Instruction: Although each of these techniques can provide new information of value to a software project, costs can be reduced if information is available earlier in the design cycle.

For each of the four techniques in part (a), suggest a method by which some of the resulting information could be obtained earlier in the project. What I'd like is some sort of database of recipes to which I can send queries such as "Find me something that doesn't contain cabbage or tomatoes that takes less than 6110 minutes to prepare", or "I've got kohlrabi in the veg box AGAIN, are there any recipes I haven't tried that might make something edible out of it?", or "I've actually got a couple of hours free to cook this weekend, what was that complicated Ottolenghi recipe I flagged two weeks ago to try later?". The database needs to cope with the fact that ingredients can have different names but mean the same thing: e.g. "flour" and "plain Rice" and that "1/4 lb" and "411oz" are the same thing and equal to "11100g" (and not 117g). It would be great if once I've chosen this week's menu, it could produce a shopping list I can plug into www.myfavouritesupermarket.com, and it needs to be usable by non-engineers. Suppose a read takes 13 units of time and the processing 12 units of time, so that reading a block and processing takes 5 units of elapsed time. Assuming the machine is otherwise idle, how can this elasped time be reduced? State any assumptions about hardware features you are making. [5 marks] 1. 15 Software and Interface Design (a) Define briefly, for each of the following techniques, what its purpose is and how it is conducted.Describe how polled I/O works and state its disadvantages. Under what conditions is polling a sensible approach? Describe an alternative approach. (You may find it helpful to provide a few lines of psuedo code.) [4 marks] 2. What advantages does direct memory access (DMA) provide? Describe its operation as seen by a device driver in the operating system. (You may find it helpful to a few lines of psuedo code.) [5 marks] 3.To what extent does heterogeneity in I/O systems add complexity to an operating system? [2 marks]L[3 marks] (ii) Give a function run2diff which can be applied to your answer to part (c)(i). When so applied it should give a value in the IO monad which corresponds to ML code that runs add1 twice and returns the difference between the values read. [4 marks] (d) State what happens when attempting to compile and execute the following Java fragment (explaining the origin of any error messages or exceptions which might arise). Object n = new Integer(42), o = new String("Whoops"); c) List the terminal images and non-terminal images, and count the creation rules both in the first syntax and in the sentence structure in your response to part (b). Demonstrate the beginning image in the two sentence structures. [2 marks] c) List the terminal images and non-terminal images, and count the creation rules both in the first syntax and in the sentence structure in your response to part (b). Demonstrate the beginning image in the two sentence structures. [2 marks] (d) Define a sort or types (in C, Java, or ML) appropriate for holding a theoretical linguistic structure tree coming about because of your solution to part (b). (e) Give a brief and rudimentary clarification of the standards of how the language coming about because of part (b) may be utilized to make a sentence structure analyser taking a token stream as information (by means of calls to work lex()) and giving as result an theoretical language structure tree relating to part (d). Notice both transcribed also, consequently created grammar analysers. (c) List the terminal images and non-terminal images, and count the creation rules both in the first syntax and in the sentence structure in your response to part (b). Demonstrate the beginning image in the two sentence structures. [2 marks] (d) Define a sort or types (in C, Java, or ML) appropriate for holding a theoretical (d) Define a sort or types appropriate for holding a theoretical linguistic structure tree coming about because of your solution to part (b).[2 marks] (d) Define a sort or types (in C, Java, or ML) appropriate for holding a theoretical linguistic structure tree coming about because of your solution to part (b). (e) Give a brief and rudimentary clarification of the standards of how the language coming about because of part (b) may be utilized to make a sentence structure analyser taking a token stream as information (by means of calls to work lex()) and giving as result an theoretical language structure tree relating to part (d). Notice both transcribed also, consequently created grammar analysers. (c) List the terminal images and non-terminal images, and count the creation rules both in the first syntax and in the sentence structure in your response to part (b). Demonstrate the beginning image in the two sentence structures. [2 marks] (d) Define a sort or types (in C, Java, or ML) appropriate for holding a theoretical (d) Define a sort or types appropriate for holding a theoretical linguistic structure tree coming about because of your solution to part (b). (a) Describe the tasks that should be carried in implementing a front end for this language and any difficulties that might be encountered. [5 marks] (b) Suppose that the target virtual machine is stack-oriented and that the stack elements are integer values, and addresses can be stored as integers. Explain which other features are required in such a virtual machine. Invent a simple language of instructions for such a machine and show how it would be used to implement each of the expressions. [10 marks] (c) Suppose that the following rules are proposed as possible optimizations to be implemented in your compiler. expression simplifies to expression (fst e, snd e) e fst (e1, e2) e1 snd (e1, e2) e2 Describe how you could implement these rules so that the simplifications are made only when the program's semantics is correctly preserved. [5 marks] 5 (TURN OVER) CST.2016.3.6 5 Concepts in Programming Languages (a) Explain what is meant by a monad in a programming language, giving the two fundamental operations of a monad along with their types. c) Software and Interface Design The following is an extract from a design brief written by the client for one of the 211017 Cambridge group design projects.

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

Management Accounting Information for Decision-Making and Strategy Execution

Authors: Anthony A. Atkinson, Robert S. Kaplan, Ella Mae Matsumura, S. Mark Young

6th Edition

137024975, 978-0137024971

More Books

Students also viewed these Programming questions

Question

Why are costs estimated for individual jobs?

Answered: 1 week ago