SOLVE ALL coroutine to merge, in increasing order, two infifinite…
Question Answered step-by-step SOLVE ALL coroutine to merge, in increasing order, two infifinite… SOLVE ALL coroutine to merge, in increasing order, twoinfifinite streams of increasing integers supplied by two other coroutines.[5 marks](c) Brieflfly outline how you would implement an analogous merging mechanism inan object-oriented language, such as Java, that does not provide a coroutinemechanism. [5 marks]6 Compiler Construction(a) Describe one possible structure (e.g. ELF) of an object fifile. Illustrate youranswer by considering the form of object fifile which might result from thefollowing C program.int a = 1, b = -1;extern int g(int);extern int c;int f() { return g(a-b) + c; }It is not necessary to consider the exact instruction sequence, just issuesconcerning its interaction with the object fifile format. [10 marks](b) Describe how a linker takes a sequence of such programs and produces anexecutable fifile. [4 marks](c) Compare and contrast static and dynamic linking in a system using your objectfifile format. [6 marks]4CST.2001.6.57 Prolog for Artifificial IntelligenceA weighted binary tree can be defifined using compound terms in the following way.A node of the tree is represented by the term n(V, L, R), where V stands for thevalue of the node, and L and R stand for the left and right branches, respectively.A terminal node has the R and L components instantiated to the null list.Given an input tree T, write a Prolog program that constructs a tree of the sameshape as T, but in which the value of each node has been set to the value of themaximum value node in T.[Note: Maximum marks are available only for programs that perform this task inone recursive descent of the input tree, and which use no more than four clauses.][20 marks]5[TURN OVERCST.2001.6.68 DatabasesThe environmental agency is setting up an SQL database to monitor long-termtrends in the climate. Data are collected from observatories of a number of difffferentkinds.Flood risk is of particular concern. Each water authority measures river levels andrates of flflow hourly at major points, and records reservoir levels daily.In addition, the agency maintains weather stations both inland and at sea. Theserecord precipitation (rainfall etc.), temperature, sunshine, air pressure and wind.Values of new precipitation, temperature, pressure, and wind speed and directionare taken hourly; gusts of over 60 m.p.h. are noted whenever they occur.Maximum and minimum temperature and pressure, the total number of hours ofsunshine and the total precipitation are recorded daily. Inland stations can begrouped by water authority.By default these primary data will be relegated to archive after 2 years. Selectedinformation is retained permanently in a data warehouse. This serves two purposes.First, it holds monthly summary data consisting of the maximum (and minimumas appropriate) day value for each statistic, together with the monthly totals ofsunshine and precipitation. The warehouse also keeps detailed information relatingto periods of extreme weather from the relevant observatories, with one or morekeywords describing the nature of the incident (flflood, blizzard, hurricane etc.) andan optional comment.Write notes to assist in the design of the schema for the relational data warehouse,including any diagrams that you fifind helpful. Explain how your design will enablemeteorologists to fifind relevant past records, noting any assumptions that you makeImage transcription textA valid Java arithmetic expression withno parentheses is evaluated from left toright: * (1 Point) True False… Show more… Show more Computer Science Engineering & Technology Java Programming CS MISC Share QuestionEmailCopy link Comments (0)


