Question
Compose program to information and print whether a number is positive or negative. complete java program that prompts the client for their name and two
Compose program to information and print whether a number is positive or negative. complete java program that prompts the client for their name and two numbers. Compose program that will request that the client enter your name and your class segment
Some systems administration scientists wish to explore the way of behaving of a systems administration convention when it is working over significant distance (high dormancy) joins. To do this, they mean to assemble an organization postpone test system , which they will use to interconnect a couple of organization hubs. Working simultaneously on each connection bearing, the gadget will get the information stream, postpone it, then send it onwards to the next hub. The organization utilizes a sequential connection working at one gigabit each second, and the analysts expect to have the option to shift the postponement, for example, to reenact connections of between 1 and 5000 kilometers long. network hub
Programming answers ought to be written in some documentation approximating SML or OCaml. (a) Describe what is implied by tail recursion. [4 marks] (b) Eliminate tail recursion from foldl given underneath. Make sense of your response. (* foldl : ('a - > 'b - > 'a) - > 'a - > 'b list - > 'a *) let rec foldl f accu l = coordinate l with [] -> accu | a::l - > foldl (f accu a) l [8 marks] (c) Eliminate tail recursion from the accompanying commonly tail-recursive capacities. Make sense of your response. let rec is_even n = if n = 0 then evident else is_odd (n - 1) also, is_odd n = if n = 0 then, at that point, misleading else is_even(n - 1)
Consider composing a compiler for a straightforward language of articulations given by the accompanying language, e ::= n (whole number) | ? (peruse whole number contribution from client) | e + e (expansion) | e ? e (deduction) | e ? e (augmentation) | (e, e) (match) | fst e (first projection) | snd e (second projection) (a) Describe the assignments that ought to be conveyed in carrying out a front end for this language and any hardships that may be experienced. [5 marks] (b) Suppose that the objective virtual machine is stack-situated and that the stack components are whole number qualities, and addresses can be put away as numbers. Make sense of which different highlights are expected in a particularly virtual machine. Concoct a straightforward language of directions for such a machine and show how it would be utilized to carry out every one of the articulations. [10 marks] (c) Suppose that the accompanying guidelines are proposed as potential advancements to be executed in your compiler. articulation streamlines to articulation (fst e, snd e) ? e fst (e1, e2) ? e1 snd (e1, e2) ? e2 Depict how you could execute these principles with the goal that the improvements are made just when the program's semantics is accurately safeguarded. [5 marks] 5 (TURN OVER) CST.2016.3.6 5 Concepts in Programming Languages (a) Explain what is implied by a monad in a programming language, giving the two major tasks of a monad alongside their sorts. [3 marks] (b) Consider the utilization of a monad for input-yield. For the reasons for this inquiry, accept the IO monad as including two activities readint and writeint which separately read whole numbers from stdin and compose whole numbers to stdout. Give the sorts of these administrators. [2 marks]
Please help with code package com.abc.handoff; Import com.abc.pp.stringhandoff.String Handoff; Import com.programix.thread.Shutdown Exception; Import com.programix.thread.TimedOut Exception; public class StringHandofflmpl Implements StringHandoff { private String message: public StringHandofflmpl() { message = null; } @Override public synchronized vold pass(String msg, long msTimeout) throws Interrupted Exception, Timed OutException, Shutdown Exception, IllegalState Exception { } @Override public synchronized vold pass(String msg) throws Interrupted Exception, Shutdown Exception, IllegalState Exception { pass(msg, OL): } @Override public synchronized String receive(long msTimeout) throws Interrupted Exception, TimedOutException, Shutdown Exception, IllegalStateException { } //same method as above without the timeout limitation @Override public synchronized String receive() throws Interrupted Exception, ShutdownException, IllegalState Exception { return receive(OL): } @Override public synchronized vold shutdown() { message = null; notifyAll(): || } @Override public Object getLockObject() { return this; }
Step by Step Solution
3.40 Rating (162 Votes )
There are 3 Steps involved in it
Step: 1
I can help you with that Lets start by addressing the Java program to prompt the client for their name and two numbers and then determine whether the numbers are positive or negative Heres the Java co...Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started