AP Computer Science Principles Premium, 2023 by Seth Reichelson

AP Computer Science Principles Premium, 2023 by Seth Reichelson

Author:Seth Reichelson
Language: eng
Format: epub
Publisher: Barrons Educational Services
Published: 2022-11-27T00:00:00+00:00


45.Which of the following statements describes the major building blocks of algorithms?

I.Sequencing—statements execute in a given order

II.Selection—Boolean conditions determine an algorithm’s path

III.Iteration—the repetition of parts of an algorithm

(A)I only

(B)I and II only

(C)II and III only

(D)I, II, and III

46.A programmer is writing code to display the difference of the squares of two user-inputted numbers (i.e., a2 − b2). The following lines represent parts of the code. What order should they be placed in?

1.DISPLAY(a - b)

2.b ← INPUT()

3.a ← a * a

4.a ← INPUT()

5.b ← b * b

(A)1, 2, 3, 4, 5

(B)1, 2, 4, 5, 3

(C)2, 4, 3, 5, 1

(D)4, 2, 5, 1, 3



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.