Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

(b) Consider tne touowing Suppose an amateur programmer writes a program for his

ID: 3912908 • Letter: #

Question

(b) Consider tne touowing Suppose an amateur programmer writes a program for his or her own use and in doing so is sloppy in the program's construction. The program does not use the programming language features that would make it more readable, it is not efficient, and it contains short cuts that take advantage of the particular situation in which the programmer intends to use the program. Over time the programmer gives copies of the program to friends who want to use it themselves, and these friends give it to their friends. To what extent is the programmer liable for problems that may occur? y.p There are only three possible integers that could be assigned to variable my Random after the following line of code. Name them. (6 pointe) ((int),(Math.random () 1000) ) % 3 + 5: * int myRandom =

Explanation / Answer

Q

The programmer is liable for the problems that will occur as the code is not readable so one could not unsrrunder what is going on and the programmer is using shortcuts which might not be known to everyone and it only works in specific scenarios according to the programmer and hence he is responsible for the problems that occur when the program is used.

Q5

The three possible values will be 5,6,7 as when we take remainder of something with 3 the result possible is 0,1,2 and we are adding 5 to it so the Possible values are 5,6,7

Q. Next image

The random() method returns a double value with a positive sign, greater than or equal to 0.0 and less than 1.0.

Hence the correct answer would be D as 10*math.random() returns value between 0.0 and 10.0

And adding it to 20 we have the result between 20 to 30