ap computer science test 1

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

Which of the following statements comparing low-level programming languages (such as assembly language) and high-level programming languages (such as python or java) are correct?

-A program written in a low-level language is closer in syntax to the binary code understood by computers than a program written in a high-level language. -A program written in a high-level language will usually be easier for a person reading the code to understand than one written in a low-level programming language.

what is a low level language?

A direct translation of machine language using an abbreviated syntax. Guaranteed to be unambiguous. Less natural for humans, but still readable to the trained eye. Easy for machines to parse.

Jama is creating a program which calculates the square roots of whole numbers. The program will store the results of each square-root as a variable. Which of the following data-types would be best used for this variable?

float

What are the iterative development cycle stages?

idea, algorithm, create, test, document

what is source code?

programs written in high-level languages.

what is high level language?

Relatively easy for humans to read, write, and parse. Guaranteed to be unambiguous. Easy for machines to parse.

Microsoft Excel® is a spreadsheet program that can be used for computing the average of a list of values in cells A1 through A20 with a command such as =AVERAGE(A1:A20). After the user initiates this command, the command disappears and the average (or mean) of the list of numbers appears. Why is this an abstraction?

The average can be viewed without knowing the process of how the average was computed.

The following algorithm is proposed for the task of baking a cake, and is presented along with a list of ingredients. Add some ingredients from the list to a bowl Stir Add other ingredients to a bowl Stir Put in a tin in the oven Take out tin from oven Which of the following correctly describes an issue with the way the instructions in this algorithm is presented?

The instructions lack descriptive qualifiers

Which of the following best describes why the development process by which computer programs are created is described as "iterative"?

The process is a cycle, with results from one run of the cycle feeding into the next.

Erin has written a program which presents a user with multiple-choice quiz questions to answer and calculates a percent score based on the number the user got right or wrong. Each question has 5 possible answers, and scores presented are from 0 to 100 percent inclusive. Which of the following could be represented by a Boolean variable?

Whether a user got a specific question right or not

what is done in the algorithm stage in the iterative development process?

create a visual representation (graph, chart, etc.) of what will be done to help solve the problem

Which of the following is a simplified but equivalent Boolean expression to the following:(X > 0 AND X ≤ 20) OR (X > -5 AND X < 15)

(X > -5) AND (X ≤ 20)

Which of the following best describe examples of abstraction (Select two answers).

-A developer writing a program for calculating properties of shapes uses a variable pi to store a decimal approximation of the number π (~3.14159). They use this variable whenever they need to use the number π to calculate an area or volume. -A sheet of music for guitar is written as a series of chords (e.g C, Am, G7). Each of these represents multiple notes which are played simultaneously on different strings of a guitar.

Which of the following describes algorithmic solutions to problems: I. A set of step by step instructions for assembling a piece of furniture. II. A flowchart used to make important decisions on which actions to take in an emergency situation III. A recipe for baking a cake with detailed numbered steps to follow

I, II and III

The following algorithm is presented for assembling a piece of furniture from 12 individually numbered parts. -Parts 1, 5, and 11 -Parts 2 and 10 - Part 12 -Parts 6 to 9 inclusive -Parts 3 and 4 Which of the following correctly describe issues with the way these instructions are presented? I. There instructions lack the required descriptive qualifiers II. The instructions lack the required imperative statements III. The order in which the instructions should be performed is unclear

II only

Rick is in charge of a team developing a program which will be used by businesses to control stock. The team has already consulted with potential clients and developed an idea of what inputs will be required and the likely outputs that will be produced from these inputs. Which of the following should Rick and his team do next?

Plan the structure of the program and determine how the major algorithms will work

Consider constructing an algorithm for a robot that can only perform the following three predefined operations. MOVE_FORWARD ( ): The robot moves one square forward in the direction it is facing. ROTATE_LEFT ( ): The robot rotates in place 90 degrees counterclockwise (i.e., makes an in-place left turn). ROTATE_RIGHT ( ): The robot rotates in place 90 degrees clockwise (i.e., makes an in-place right turn). Which of the following algorithms could successfully cause the robot to trace out a "T"-shaped path as drawn above? (sorry I couldn't add a picture so I did the best I could and it does not always show up in the correct shape of a t but i tried) ____(starts ~> here)_____ I I I

Step 1: MOVE_FORWARD ( ) Step 2: MOVE_FORWARD ( ) Step 3: ROTATE_LEFT ( ) Step 4: ROTATE_LEFT ( ) Step 5: MOVE_FORWARD ( ) Step 6: ROTATE_RIGHT ( ) Step 7: MOVE_FORWARD ( ) Step 8: MOVE_FORWARD ( )

what is done in the document stage in the development process?

comments are created in the code to help when making modifications

What is done in the idea stage in the iterative development process?

find a problem and a possible solution to said problem

what is binary code?

machine code that is a direct, low-level translation from the high-level source code, and is a pattern of 0s and 1s.

what is machine code?

machine-level instructions that are uniquely read by computer processors using patterns of 1s and 0s.

Which of the following is an example of code written in a high-level programming language?

num1 = 8 - 3 num2 = 2 * num1 + 1 print(num2)

Roxanne is writing a program which will be used to display information to passengers on a flight. Some of the variables she will use for her program are as follows. speed - the current speed of the airplane relative to the ground in meters per second passengers - the number of passengers on-board the plane destination - the name of the destination airport of the flight

speed - float, passengers - int, destination - string

what is done in the test stage of the iterative development process?

the code is ran to see if all aspects work the way they should

what is done in the create stage in the iterative development process?

the code to solve the problem is created

what is abstracion?

the process of removing or suppressing details to create a manageable level of complexity. (essentially like an abbreviation ex. Alabama ~> AL)

Which of the following best describes how abstraction makes code written in higher-level programming languages easier for humans to parse?

Abstractions used in higher-level languages mean what a command does is easier to understand without needing to parse all the individual operations performed by the CPU.

Which of the following variable types is characterized by allowing only two possible values to be stored?

Boolean

Which of the following statements about variables in programming are true? I. Variables allow a value to be stored for future use II. Once the value of a variable is set it cannot be changed III. The name given to a variable is important for human comprehension, but not for the computer.

I and III only

Marta is writing a program for a home-automation system. Three of the variables in her program are as follows: light - A variable which determines whether the lights in a room are switched on or off temp - A variable which records the temperature of the room to the nearest whole degree Fahrenheit name - A variable which records the name the user has set for the room (e.g. "kitchen") Which of the following correctly describes the types which would be best used for each of these variables?

light - boolean, temp - integer, name - string

Rhys is creating a program which stores customer records. One variable used in the program stores the first initial of a customer's name. Which of the following data-types could be used to store this data?

-Character -String

Which of the following statements are NOT true about high level programming languages? Select two answers:

-Code written using high level languages is guaranteed to be ambiguous -Any particular algorithm will be written in the same way regardless of which high level programming language is used


Set pelajaran terkait

C845 - Chapter 4: Incident Response and Recovery

View Set

Exercise 2: Organ Systems Overview

View Set

EXSC 345 Research Design Quizzes (1-9)

View Set

Military History: George Washington

View Set