Quiz 1 - Command Line, Java, Recursion

.pdf

School

Columbia University *

*We aren’t endorsed by this school

Course

W3134

Subject

Computer Science

Date

Apr 3, 2024

Type

pdf

Pages

4

Uploaded by DeanRamMaster2400

Report
2/26/24, 11:47 PM Quiz 1 - Command Line, Java, Recursion: COMSW3134 001 2024 1 - DATASTRUCTURES IN JAVA Quiz 1 - Command Line, Java, Recursion e Due Feb 1 at 11:55pm e Points 10 e Questions 8 e Available Feb 1 at 12pm - Feb 1 at 11:55pm 11 hours and 55 minutes e Time Limit 15 Minutes e Allowed Attempts 2 This quiz was locked Feb 1 at 11:55pm. Attempt History Attempt Time Score KEPT Attempt 2 2 minutes 10 out of 10 LATEST Attempt 2 2 minutes 10 out of 10 Attempt 1 14 minutes 8 out of 10 Score for this attempt: 10 out of 10 Submitted Feb 1 at 11:26pm This attempt took 2 minutes. (Suestion 1 1/1 pts Suppose the current working directory is: /nome/user/workspace/src If you run the command cd ../src and then run pwd what is printed on the screen? Correct! /home/user/workspace/src Correct Answers /home/user/workspace/src Question 2 1/1 pts Suppose there are multiple .java files in your current working directory, including “Fun.java”. Course Chat - https://courseworks2.columbia.edu/courses/190971/quizzes/195373 1/4
2/26/24, 11:47 PM Quiz 1 - Command Line, Java, Recursion: COMSW3134 001 2024 1 - DATASTRUCTURES IN JAVA What command can you run to compile ONLY the “Fun.jav: Correct! javac Fun.java Correct Answers javac Fun.java Question 3 1/1 pts Suppose a file named “Fun.class” is located in your current You want to run the program with command-line arguments would you type? Correct! java Fun 4 14 Correct Answers java Fun 4 14 A Send Question 4 2/ 2 pts Fill in the blank to complete the following method: /** Computes the sum of elements in an array of integers, starting from a specified index. @param nums the array @param index the starting index for the sum calculation @return the sum of all elements in the array */ public static int sumArray(int[] nums, int index) { if (index == nums.length) { return 0 return = NUMS[index] + sumArray(nums, index+1l); } https://courseworks2.columbia.edu/courses/190971/quizzes/195373 2/4
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help