CSP Test Unit 3

¡Supera tus tareas y exámenes ahora con Quizwiz!

In the following code segment, score and penalty are initially positive integers. The code segment is intended to reduce the value of score by penalty. However, if doing so would cause score to be negative, score should be assigned the value 0.Which of the following changes can be made so that the code segment works as intended?

Interchanging lines 3 and 7

Which answer below is not a benefit of an iteration?

Less efficient

Event Handlers in MakeCode include (choose all the correct answers):

Overlap events and Lifecycle events 🡪 Sprites, Button presses and connected players 🡪 Controller, Game update and time passing 🡪 Game, Hits wall and overlap events 🡪 Scene, If, then and If, else 🡪 Logic

Which of the following best compares the values displayed by programs A and B?

Program A and program B display identical values in the same order

Constant data types (choose all the correct answers):

Stay the same every time a program is executed. Are "hard coded"

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?

The cost of a food item currently available for order.

In a certain computer program, two positive integers are added together, resulting in an overflow error. Which of the following best explains why the error occurs?

The program can only use a fixed number of bits to represent integers

Considering the robot code below, which direction, if the robot is facing upward, will the front of the robot be facing after the code is complete?

Upward

Logic error

a mistake in the algorithm or program that causes it to behave incorrectly or unexpectedly.

Run-time error

a mistake in the program that occurs during the execution of a program; programming languages define their own run-time errors.

Syntax error

a mistake in the program where the rules of the programming language are not followed.

Event handler

a part of code that 'handles' or listens for a specific type of event; when that event occurs, the code inside the event handler is run.

Iteration

a repeating portion of an algorithm; it repeats a specified number of times or until a given condition is met.

Overflow error

an error that occurs when a computer attempts to handle a number that is outside of the defined range of values.

Nested conditional statements

consist of conditional statements within conditional statements.

Selection

determines which part of an algorithm is executed based on a condition being true or fals

Pseudo-random numbers are generated from physical phenomena that take place outside of the computer.

false

The following code represents a Sequencing algorithm

false

The following code represents an Iteration algorithm

false

String concatenation

joins together two or more strings end-to-end to make a new string.

The three different constructs used in algorithms are:

sequencing, iteration, selection

Proper variable names (choose all the correct answers):

stateName personName, carModel

What is the substring text in the variable answerIs?

taking test

Sequencing

the application of each step of an algorithm in the order in which the code statements are given.

A Boolean value is either true or false

true

Abstraction can be experienced by the design of a product which allows you to use it without understanding the complexity of the product, or the complex process that happens every time you press a button or turn a key.

true

Comments on your code are a form of program documentation written into the program to be read by people and do not affect how the program runs.

true

String variable can have text or numbers and require the stored information to be in " " (quotes)

true

The following code represents an Selection algorithm:

true

The purpose of computing innovations is to solve problems or to pursue interests through creative expression.

true

What is an algorithm?

. Set of instructions for solving some problems, step by step

Considering the Modulus Operator (modulo), select all the answers below that are correc

40 mod 2 = 0 29 mod 3 = 2

In the following procedure, the parameter age represents a person's age. The procedure is intended to return the name of the age group associated with age. People who are under 18 are considered minors, people who are 65 and older are considered senior citizens, and all other people are considered adults. The procedure does not work as intended.Removing which two lines of code will cause the procedure to work as intended?

8 and 10

Variable data types (choose all the correct answers):

Are an abstraction inside a program that can hold a value. Can change.

Which of the answers below is not a text coding tip within MakeCode?

Autotype

What is the correct order of the programming environments below when thinking of highest to lowest abstraction?

Block Code, Text Code, Machine Code

Which of the following changes will not affect the results when the code segment is execut

Changing line 3 to b ← 10

Which statement is false when considering what computers are better at than humans?

Computers can tell good jokes

(trapezoid)

Data

(sideways diamond)

Decision

A flowchart is (choose all the correct answers):

Diagram of steps in a process. Visualize an algorithm. Helpful for writing programs

Select the different types of loops in MakeCode

Forever - will repeat forever, Repeat - repeats for the designated number of times, For loop - similar to repeat, but uses an index variable, While loop - repeats until a certain condition is met


Conjuntos de estudio relacionados

Michigan State Insurance Exam 6/3/2021

View Set

Health Assessment - Urinary System

View Set

CH 18 SMARTBOOK: Gram Positive Cocci of Medical Importance

View Set

chapter 3 human ap migration "study guide"

View Set

LearnTEFL Final (correct answers only)

View Set