Edited Invalid date

0

0

Quiz

Chapter 17 -- Part 1: Practicing Programming Languages

- On the AP Computer Science Principles exam, the programming language you used to understand may look different.
- Common programming languages can be seen.

- A way to display and assign variables.

- Adding, subtracting, multiplication, division, and modulus are some of the arithmetic operators that can be used.

- Functions that you can create or modify to take parameters, perform an action, or return values are called procedures or methods.

- A way to compare two values, including greater than or less than.

- List operations include how to add or remove items from a list.

- A way to control the movement of an element in a game.

- You will get an exam reference sheet when you take the exam.

- The Programming Language is summarized in this sheet.

- No matter which language or environment you choose for this course, you should be familiar with most of these categories.

- You should be prepared to handle any of the categories shown on the exam.

- When you take your exam, you will be given an Exam Reference Sheet, so now is a good time to become familiar with it.
- Appendix G of this book is where it is reproduced.
- Refer to it as you read the pages.
- You don't need to memorize the reference sheet since you will have it when you take the exam.

- Instructions in computer science allow you to modify, see, or get from a user in a program.

- The questions are designed to help you practice the code you will see in the exam.

- The categories are combined to check what you know about computer science.

- The examples give you an idea of the language you will see in the exam.

- The questions on the exam are more difficult than the examples here.
- They are here to help you learn how to use the exam reference sheet and practice multiple-choice questions.

- There is a full-length practice End-of-Course Exam that comes with this crash course.
- The exam reference sheet should be used when taking the practice exam.

- The code is shown to the right.
- A person might want to test this code.
- They type 7 when they reach line 3.

- A person can't use the INPUT function to interact with this program.
- A message would be printed out.

- The assignment would not happen since nothing is returned from the INPUT function.

- The answer choice is not correct because the answer was called correctly as shown in the table.
- An example of a syntax error would be if Line 3 said: "InPUT() - x".
- The answer choice is not correct because INPUT is able to accept and return any user of the program types.
- The answer choice is not correct because display puts a space after printing.

- The exam reference sheet will be helped by the example questions in this chapter.
- There are no questions that are true or false on the End-of-Course Exam.

- Blocks or text could be used for the exam.
- You need to know how to read both types.

- Group of questions that refer back to one situation is common on the AP CS Principles exam.
- It's in your best interests to go through the exam in order and not skip too much.
- Many questions will refer to a specific scenario or set of code.
- You may become confused if you skip around when answering questions.
- If you have more time after you finish, you can check your answers again.

- A person is writing.
- She wants the program to say hello.

- The person has a name.

- "Hello BELLA" will be displayed on the computer.

- If you understand that order of code matters and that the INPUT command is needed to get user input in a program for this language, then this question is for you.
- The space will print after "Hello" since it happens through the call to the DISPLAY instruction.
- The input command is called before the user is prompted. "
- Please type your name" should be the first call to display.
- Since DISPLAY does not return anything, choice would be a syntax error.

- You can turn two inputs into one output with these instructions.
- The two inputs and the output are the same type.

- Adding is an example of an operator.
- The inputs are 2 and 3, the output is 5, and all of these are numbers.

- In a multiple-choice question, this category could be seen in code with any of the other categories.

- There are two languages shown next to each other in this book.
- On the exam, a question can only be used in one language.

- Most of the operations are familiar to you.
- It may be a new idea.

- The rest of the two numbers are being divided.

- Until it becomes automatic for you, long division can be used to understand any modulus calculation.

- The remainder of 22 is shown to the right.

- If 20 is a multiple of 4, then 20 is a multiple of 4.

- Since 20 is too large to fit into 4 it's called 4 mod 20.
- To the right is long division.

- You can't have 0 to the right.

- This would be like dividing by 0, so it doesn't make sense.

- You can get to the left of the MOD.

- Since 0 is divided by any number that is not 0, MOD 4 is zero.

- It can get a little confusing if you watch for division by 0 errors.
- The 20 mod 0 is not valid.
- The mod 20 is 0.
- The 0 can't be to the right.

- To figure out if numbers are even or odd.

- If 2 is to the right of MOD, the result of this operation will tell you if the number to the left is even or odd.

- 7 mod 2 is the first example.

- 8 mod 2 is 0.

- If MOD 2 is 1 then it is ODD.

- If MOD 2 is 0, then x is even.

- To convert from one system to another.

- 1600 hours can be converted to our normal AM/PM clock time.
- The hours are 1600 hours.
- The clock time is a 12-hour system.

- There is 16 mod 12.
- The military time is 4:00.

- If you research Modulus online, you might see that it's referred to as "clock time".

- The order of operations is followed.

- Line 7 is logically equivalent to Line 6 and 7.

- Line 8: 1.25 Division is performed.

- The remainder of 5/4 is 1 since 4 goes into 5 with a remainder of 1.

- Line 10 is 4 since 5 doesn't go into 4.
- Since the number to the left is smaller than the number to the right, the result is the number to the left of the MOD.
- For example, 4MOD 6 is 4, 2MOD 7 is 2, and 8MOD 10 is 8.

- The result of the division is 5 with no remaining.

- This is an example of Line 10 and Line 11.

- This is an error.
- You can't divide by 0 since the right of the MOD is invalid.

- A Boolean is a type of data that has one of two values.

- In a multiple-choice question, this category could be seen in code with any of the other categories.

- Don't apply to conditions.

- Be careful when applying not to operators.
- The opposite of an inequality can be false.

It's not(a>b)

- Not is a>b.

- The following rules can be used when applying not to statements.
- These are called DeMorgan's Laws.

- You don't need to know the laws by name, but you do need to know how to apply them.

- There is a parking garage.
- To help drivers find available parking spaces, a program is used to show which floor has more spaces available for parking.
- The drivers see a sign with lights in the garage.
- There are parking spaces on the floor if a light is on.
- There are no parking spaces on either floor if there are no lights.
- There are available spaces on both floors if two lights are on.
- At any one time, there could be 0, 1, or 2 lights on.

- Each floor has the same number of spaces.

- If a space is free or not, the program uses sensors.
- The last two variables are listed in the table below.

- If both floors had at least one space, Choice would be true.
- If both floors were empty Choice's statement would be true.
- If spaces are available on both floors, the lights would be on.
- The only solution that guarantees this is choice.
- If numSpaces were zero, no lights would be on.
- Choice is similar to B.
- This could be true if both floors are full.
- When both floors are full, the choice could be true.

- If both spaces are 0, the lights would be off.
- It's equivalent to (spacesFloor1=0) and (spacesFloor2=0).
- If spacesFloor2 is 0 and spacesFloor1 is equal, choice returns true.
- When both floors have an equal number of spaces, choice would not mean both lights are turned off.
- When spacesFloor2 and spacesFloor1 have point(s) in common, choice returns true.
- There are only two places where spacesFloor2 is 0 and spacesFloor1 is 0.

- The "(Sneak Peek)" written next to them is meant to give you an idea of the type of question you should be able to handle on the End-of-Course Exam.
- You should check out the sample exam that accompanies the crash course.
- The front cover of the book has your access code.

- If you notice short circuits, you can save a lot of time when evaluating the final value of Boolean statements.

- If the first condition is true, the result will always be true.

- Suppose x is 5.
- The statement is true.

- The result will always be false if the word between two conditions is AND.

- Suppose x is 5.
- The statement is false.
- This would be false no matter what x's initial value was since these two situations could never be true at the same time.

- Short-circuiting can be practiced by studying logic gates.
- This is how questions related to short-circuiting show up on the exam.

- A logic gate is part of a circuit.

- A logic gate has two inputs and one output.

- The logic gates are shown on the exam.

- There are possible combinations of inputs and outputs for any logic gate.

Assignment Panel

View flashcards and assignments made for the note

Getting your flashcards

Review

Quizzes

Mine

Others

Notifications

U

Profile

Mobile App

Privacy & Terms

Feedback

Need Help?

Tutorial

Log out