Cookie Consent by Free Privacy Policy Generator Computer Science: Programming with a Purpose Week 5 Quiz Answers - Coursera!

The basis for education in the last millennium was “reading, writing, and arithmetic;” now it is reading, writing, and computing. Learning to program is an essential part of the education of every student, not just in the sciences and engineering, but in the arts, social sciences, and humanities, as well. Beyond direct applications, it is the first step in understanding the nature of computer science’s undeniable impact on the modern world. 

This course covers the first half of our book Computer Science: An Interdisciplinary Approach (the second half is covered in our Coursera course Computer Science: Algorithms, Theory, and Machines). 

Our intent is to teach programming to those who need or want to learn it, in a scientific context. 

You can enroll here:


Computer Science: Programming with a Purpose Week 3 Quiz Answers - Coursera!

Coursera Computer Science: Programming with a Purpose Week 5 Quiz Answers!

Functions and Libraries

Question 1) Which of the following appear in a method's signature? Mark all that apply.

method body
method name
return statement
parameter variable types
parameter variable names

Question 2) Which of the following is a variable's scope in a Java library?

all the code in the same block as the declaration
all the code following the declaration, in the same block
all the code in the library following the declaration
all the code in the same method as the declaration
all the code in the library

Question 3) Consider this static method:

public static String duplicate (String s)
{
  String t - s+ s;
  return t;
}

What does this code fragment print?

String s1 = "Hi";
s1 = duplicate (s1) ;
String t1 = "Bye";
t1 = duplicate(duplicate (t1));
StdOut.println (s1 + t1):

HiHIByeByeByeBye

Question 4) Which of the following are properties of modular programming? Mark all that apply.

Enables code reuse
Complicates debugging
Separation of clients from implementations
Independent development of programs of manageable size
Development of all the code for a task within a single module

Post a Comment

Previous Post Next Post