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

please solve the following ASAP please solve the following ASAP Arrange the prog

ID: 658668 • Letter: P

Question

please solve the following ASAP

please solve the following ASAP

Arrange the programming languages in the order of increasing execution speed, from the slowest to the fastest. Python Tcl Java C Which of the following statement(s) are true about closing a previously opened file? (Select all that apply) It is recommended to explicitly close all previously opened files. All previously opened files are automatically closed by the Python interpreter when the program terminates. If a program terminates with one or more open files, the contents of these files is lost. If a program terminates with one or more open files, an exception is raised. If a program opens too many files, some of them shall be closed to make space for more open files. The recursive function equal(a, b) supposedly compares two lists, a and b, and returns True if they are equal and False if they are not: def equal (a, b); if a[0] ! = b[0]; return False return equal (a[1;], b[1;]) Which statement(s) is/are true about this function? (Chack all that apply.) This function always crashes. This function is tail recursive. This function has a base case. This function correctly compares a and b. How many main() functions can a Java project have? One or more. Zero or more. Exactly one. No more than one. What is the most efficient way of displaying all values in the dictionary names in a user-friendly, human-readable format? (No commas or parentheses.) print (names.values (0) s = " " for val in names.values (); s + = val + " " print(s) print (" ", join (names.values ()) print (names) Which Java keyword corresponds to the first parameter of every Python class method? self this super public What is the exact output of the following code fragment? try: print (math.sqrt (-9)) except: print (3.14159) print ("Done!") 3.14159 Done! -3 Done 3.14159 What is the correct sequence of steps involved in copying a file A to a file B? Write data to the file B. Read data from the file A. Close the files A and B. Open file A for reading and file B for writing. Why is it a good idea to declare all class attributes private? Python and Java require that all attributes are declared private. Other classes cannot uncontrollably modify private attributes. Private attributes make programs faster. Private attributes make programs smaller.

Explanation / Answer

1)Java , Tcl, Python, C

2) It is recommended to explicitly close all previously opened files

If a program opens too many files, some of them shall be closed to make space for more open files

3) The fucntion has a base case

The fucntion correctly compares a and b

4) one or more

5) 2nd option

6) this

7) 3.14159

Done!

8) Steps in correct order: 4, 2, 1, 3

9) Other classes cannot uncontrollably modify private attributes