Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Briefly depict ASCII and Unicode and cause to notice any connection between them. [3 marks] (b) Briefly make sense of what a Reader is with

Briefly depict ASCII and Unicode and cause to notice any connection between them. [3 marks] (b) Briefly make sense of what a Reader is with regards to perusing characters from information. [3 marks] An amateur developer has composed the accompanying duplicating program which is expected basically to peruse characters from information each in turn and to work them out. public class Copying { public static void main(String[] args) { int ch; while ( Unfortunately this program causes an assemble time mistake. Make sense of what the issue is and adjust the code with the goal that the program incorporates. [3 marks] (d) The revised program accurately duplicates information in basic cases yet is found to bomb when intriguing characters are experienced. Why would that be? [3 marks] (e) By taking advantage of a Reader, rework the program... What are the main qualities of a connected rundown? [2 marks] (b) Consider a stack that comprises exclusively of characters. A connected rundown can be utilized to demonstrate such a stack and a developer has left on a class ChLink which starts hence: class ChLink { private scorch val; private ChLink next; public ChLink() { this.val = '\\'; this.next = invalid; } The backstroke character '\' is saved and denotes the lower part of the stack. For what reason does it need to be entered in two times? [1 mark] (c) Augment class ChLink with two techniques push(char) which pushes a person onto the stack and a strategy pop() which returns the person at the highest point of the stack and, except if it is backstroke, eliminates that person from the stack. Popping the base marker is preposterous. [10 marks] (d) Write a test program which utilizations class ChLink to confirm that an arrangement of square sections is appropriately settled. The test program could start accordingly: public class ChLinkEx { public static void main(String[] args) { char[] chseq k(); for (int i=0; I

(a) Show how you would make Java exhibit of 1000 whole number qualities. [1 mark] (b) The qualities in an exhibit could be utilized to address digits in the decimal portrayal of a number. For instance, the number 1 7 has decimal portrayal 0.142857 . . . what's more, that could be put away in a cluster whose components began {1, 4, 2, . . .}. For a number put away that way compose code that duplicates the number by a given whole number, returning the entire number piece of the outcome and leaving the exhibit refreshed to hold the fragmentary piece of the item. [5 marks] (c) To change a part over to a portrayal base 16 (for example hexadecimal) you can increase it by 16, and the subsequent number part is the principal digit of the base-16 portrayal. Increasing the portion left over by 16 gets the subsequent digit, etc. Compose technique that acknowledges a variety of digits (base 10) and makes and returns another cluster addressing a similar portion yet presently base 16. Your code ought to work for any length input cluster, not only one of length 1000, and you might cause the result exhibit to have a similar length as your feedback cluster. [6 marks] (d) Suppose the contribution to your strategy to a limited extent (c) was of length 1000 and gotten going with the decimal digits of 1 7 in it. Albeit the underlying digits in the result exhibit are the right hexadecimal portrayal of 1 7 the last barely any wind up looking odd. Make sense of. [3 marks] (e) One method for guaranteeing that mathematical outcomes are right is to utilize stretch number juggling. A worth is addressed as a couple of clusters, one addressing a number not exactly (or equivalent to) the genuine worth and one a worth more noteworthy than it. So assuming utilizing 6 decimal places the number 1 7 would be held as a couple the two last digits contrast by all things considered 1 then the more modest of them can be seen as completely exact. Utilizing this thought, compose code that acknowledges a division in decimal structure and returns a vector meaning a similar worth in another base n (presently as of now not really 16) with the end goal that every one of the digits in the outcome vector are right. Clearness in your code is to be liked to execution, yet assuming that you know about specific manners by which the code you present is especially wasteful, you ought to note and make sense of them

For every one of the accompanying sets of ideas that are utilized in Java make sense of similitudes and contrasts and talk about when you would utilize one as opposed to the next. Assuming there are significant syntactic contrasts, technique names, levels of speculation conceivable or something like that, then, at that point, any code sections you give in representation ought to be basically as short as conceivable to make the ideal point. (a) JApplet and straightforward Java applications [4 marks] (b) Vector and varieties of strings (String []) [3 marks] (c) class, unique class and point of interaction

(a) In request to eliminate the upward of a capacity call, a software engineer chooses to supplant all calls to a capacity f with the full scale F, where f and F are characterized as follows: int f(int x) { return x+x;} #define F(X) (X)+(X) (I) Give two legitimate C articulations including f which produce various outcomes when F is fill in for f. Legitimize your response. [4 marks] (ii) State the C language highlight which can be utilized to accurately eliminate the upward of a capacity call. [1 mark] (b) Consider the accompanying: static struct connect { int v; struct interface *next; } *head=0; void convert(int a[], int len); Write work definition for convert which updates head to highlight a connected rundown containing the components of an in a similar request. You might expect len contains the quantity of components in a. [5 marks] (c) Consider the accompanying C++ affirmation: layout int SumSquares(); (I) Using capacity specialization, give an execution of SumSquares so that, given a number N, SumSquares() returns: X N i=1 I 2 [5 marks] (ii) Compare and differentiation the usefulness of the C preprocessor and the C++ format framework. Make sense of why it is absurd to expect to compose a C preprocessor full scale to carry out SumSquares. [5 marks]

(a) A writer composes: Most fruitful language plan endeavors share three significant qualities . . . 1. Persuading Application: The language was planned with the goal that a particular sort of program could be composed all the more without any problem. 2. Conceptual Machine: There is a straightforward and unambiguous program execution model. 3. Hypothetical Foundations: Theoretical comprehension was the reason for including specific capacities and overlooking others. Momentarily examine the benefits and additionally inadequacies of one of your preferred over three assertions, giving models as well as counterexamples from procedural, useful, sensible, or potentially object-arranged programming dialects. [6 marks] (b) For two programming dialects of your decision among FORTRAN, Algol, Pascal and C, momentarily examine and assess their composing disciplines. Further think about the benefits and inconveniences that their plans force on the software engineer. [5 marks] (c) Consider the accompanying two program sections. ( defvar x 1 ) ( defun g(z) (+ x z) ) ( defun f(y) (+ (g 1) ( let ( ( x (+ y 3) ) ) ( g(+ y x) ) ) ) ) ( f 2 ) val x = 1 ; fun g(z) = x + z ; fun f(y) = g(1) + let val x = y + 3 in g(y+x) end ; f(2) ; What are their separate result values when run in their comparing translators? Legitimize your response, making sense of it in an applied way. [4 marks] (d) Outline the key elements that a language should must be called object-arranged. Further, momentarily examine how much one programming language of your decision among Simula, Smalltalk, C++, and Java has them. [5 marks

image text in transcribedimage text in transcribed
Question 1 Identify how a computer stores the following numbers as a 4-bit signed number. (a) 4 G (c) 8 (d) 7 10 (f) -114. How productive are employees? One way to answer this question is to study annual company profits per employee. Let x, represent annual profits per employee in computer stores in Takoradi . A random sample of my = 11 computer stores gave a sample mean of x) = 25.2 thousand dollars profit per employee with sample standard deviation s, - 8.4 thousand dollars. Another random sample of /2 = 9 building supply stores in Takoradi gave a sample mean x2 - 19.9 thousand dollars per employee with sample standard deviation $2 = 7.6 thousand dollars. Does this indicate that in Takoradi , computer stores tend to have higher mean profits per employee? Use a = 0.01.Five members of the college track team in Takwa (elevation 5,200 feet) went up to Cape Coast (elevation 10,152 feet) for a track meet. The times in minutes for these team members to run 2 miles at each location are shown below. Team member Ojai Edgar Euclid Seymour Sylvia Takwa 10.7 9.1 11.4 9.7 9.2 Cape Coast 11.5 10.6 11.0 11.2 10.3

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions