Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Programming Concepts & Code Analysis Questions 1-3

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

Which of the above actions would usually be helpful in designing and developing an app?

a)

I and II only

b)

I and III only

c)

II and III only

d)

I, II, and III

2.

Which of the following best describes the purpose of a design specification?

a)

Tracking errors that arise through user testing

b)

Documenting comments that will need to be added to a program

c)

Describing the requirements for how a program will work or users will interact with it

d)

Listing detailed questions that will be asked of users during interviews

3.

What will the "background-color" of the "topButton" be when the program is finished running?

a)

red

b)

orange

c)

blue

d)

green

4.

If the user does NOT click the button what color will “topButton” be when this program finishes running?

a)

red

b)

blue

c)

green

d)

orange

5.

The following program is run. Then the user clicks the "topButton" button ONCE. What will be displayed in the console?

a)

cat bird dog

b)

dog cat bird

c)

cat dog bird

d)

bird cat dog

6.

The following program is run. Then the user clicks the “bottomButton” ONCE and then clicks the “topButton” ONCE. What will be displayed in the console?

a)

cow pig chicken

b)

cow chicken pig

c)

pig cow chicken

d)

chicken pig cow

7.

The following program is run. Then the user clicks the “bottomButton” TWO TIMES. What will be displayed in the console?

a)

apple banana cherry cherry dragon fruit

b)

banana dragon fruit cherry cherry

c)

banana dragon fruit apple apple

d)

banana cherry cherry dragon fruit

8.

Which line of code in this program is MOST likely to result in an error?

a)

Line 1

b)

Line 2

c)

Line 3

d)

Line 4

9.

Which of the following BEST describes the differences between sequential and event-driven programming?

a)

In sequential programming commands run one at a time. In event-driven programming all commands run at the same time.

b)

In sequential programming commands run faster than in event-driven programming.

c)

In sequential programming each command is run many times in sequence. In event-driven programming all commands are run a single time as an event.

d)

In sequential programming commands run in the order they are written. In event-driven programming some commands run in response to user interactions or other events.

10.

Which of the following is NOT a reason to include comments in programs?

a)

Comments help the computer decide whether certain components of a program are important.

b)

Comments help programmers debug issues in their own code.

c)

Comments help document how code was written for other programmers to use.

d)

Comments enable programmers to track their work throughout the development process.

11.

A company that develops mobile applications wants to involve users in the software development process. Which of the following best explains the benefit in having users participate?

a)

Users can identify and correct errors they encounter when using released versions of the software.

b)

Users can review the algorithms used in the software to help improve their efficiency.

c)

Users can provide documentation for program code at the end of the software development process.

d)

Users can provide feedback that can be used to incorporate a variety of perspectives into the software.

12.

A company that develops educational software wants to assemble a collaborative team of developers from a variety of professional and cultural backgrounds. Which of the following is NOT considered a benefit of assembling such a team?

a)

Collaboration that includes diverse backgrounds and perspectives can eliminate the need for software testing.

b)

Collaboration that includes diverse backgrounds and perspectives can help the team anticipate the needs of a variety of software users.

c)

Collaboration that includes diverse backgrounds and perspectives can help the team avoid bias.

d)

Collaboration that includes diverse backgrounds and perspectives can reflect the strengths of the individual team members.

13.

Which of the following best describes one of the benefits of using an iterative and incremental process of program development?

a)

It allows programmers to implement algorithmic solutions to otherwise unsolvable problems.

b)

It eliminates the need for programmers to test completed programs.

c)

It enables programmers to create programs that use the lowest-level abstractions available.

d)

It helps programmers identify errors as components are added to a working program.

14.

Three students in different locations are collaborating on the development of an application. Which of the following strategies is LEAST likely to facilitate collaboration among the students?

a)

Having all three students participate in frequent video chat sessions to discuss ideas about the project and to provide feedback on work done so far

b)

Having all three students use an online shared folder to contribute and discuss components to be considered for use in the application

c)

Having all three students write code independently and then having one student combine the code into a program

d)

Having all three students work in a shared document that each can edit to provide comments on the work in progress

15.

DineOutHelper is a mobile application that people can use to select a restaurant for a group meal. Each user creates a profile with a unique username and a list of food allergies or dietary restrictions. Each user can then build a contact list of other users of the app. A user who is organizing a meal with a group selects all the members of the group from the user’s contact list. The application then recommends one or more nearby restaurants based on whether the restaurant can accommodate all of the group members’ allergies and dietary restrictions. Suppose that Alejandra is using DineOutHelper to organize a meal with Brandon and Cynthia. Which of the following data are needed for DineOutHelper to recommend a restaurant for the group?

I. Each group member’s list of food allergies or dietary restrictions

II. Alejandra’s geographic location

III. The usernames of the people on Brandon and Cynthia’s contact lists

a)

I and II only

b)

I and III only

c)

II and III only

d)

I, II, and III

16.

A student is creating an application that allows customers to order food for delivery from a local restaurant. Which of the following is LEAST likely to be an input provided by a customer using the application?

a)

The address where the order should be delivered

b)

The cost of a food item currently available for order

c)

The credit card or payment information for the purchaser

d)

The name of a food item to be included in the delivery

17.

Which of the following actions are generally helpful in program development? I Consulting potential users of the program to identify their concerns II Writing and testing small code segments before adding them to the program III Collaborating with other individuals when developing a large program

a)

I and II only

b)

I and III only

c)

II and III only

d)

I, II and III

18.

Which of the following is NOT a benefit of collaborating to develop a computing innovation?

a)

Collaboration can decrease the size and complexity of tasks required of individual team members.

b)

Collaboration can make it easier to find and correct errors during the development process.

c)

Collaboration eliminates the need to resolve differences of opinion.

d)

Collaboration facilitates multiple perspectives in developing ideas.

19.

A student using a certain programming language finds that the operation 0.1 + 0.2 - 0.3 evaluates to 0.0000000000000001. Which of the following is the most likely explanation for this result?

a)

A logic error occurred because the student attempted to perform both addition and subtraction in the same operation.

b)

An overflow error occurred because the operation being performed involved more than two numbers.

c)

A round-off error occurred because the programming language uses a fixed number of bits to represent real numbers.

d)

A run-time error occurred because only nonzero numbers can be accurately represented in binary.

20.

A student writes the following JavaScript code to calculate the area of a rectangle.

var width = 5;

var height = 4;

var area = width * height;

console.log("The area is: " + areas);

When the student runs the program, nothing is printed, and an error message appears in the console. Which of the following best describes the type of error that occurred?

a)

Syntax error — because the code uses invalid JavaScript keywords.

b)

Logic error — because the code runs but produces an incorrect result.

c)

Run-time error — because the program tries to use a variable (areas) that has not been defined.

d)

Overflow error — because the multiplication result is too large for the computer to store.