Computer Science Principles: Self Check

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

App Inventor ROCKS!

Decode this message by converting it from binary to ASCII: 1000001 1110000 1110000 0100000 1001001 1101110 1110110 1100101 1101110 1110100 1101111 1110010 0100000 1010010 1001111 1000011 1001011 1010011 0100001

in the order they are given

Sequencing in algorithms means that each step of the algorithm is executed _____

3 2

What does the following AP CSP pseudocode display? Remember to trace through the code keeping track of the values in a and b after each line of code. a ← 1 (Set a to 1) b ← a (Set b to the current value of a) b ← b + 1 (Add 1 to b) a ← a + b (Set a to be the current value of a + b) DISPLAY(a) DISPLAY(b)

Physical circuit, logic gate, RAM chip, motherboard,

Which of the following lists arranges hardware components from the lowest to the highest abstraction level?

Data stored in a TinyDb will persist between different uses of the app. But these data are stored on the device (not in the cloud) and cannot be shared with other devices or users. A TinyDb can store strings or numbers or lists.

Which of the following statements are true for a TinyDb component.

It would crash because thereis no item with that index

What do you suppose would happen if your app asked App Inventor for the item at index 10 in the list shown here?

1/1000 of a second

how long is a millisecond?

Restructuring a program without changing its basic behavior

What does refactoring mean?

- A mobile app - A digital recording that mixes together two separate tracks of music. - A spread sheet created with Microsoft excel - A Google sites portfolio

A computational or digital artifact is something created by a human using a computer. Which of the following would be considered computational artifacts?

- paintbrush - x

A variable is an abstract symbol that refers to some particular value. Which of the following symbols is a variable?

paintBrush x

A variable is an abstract symbol that refers to some particular value. Which of the following symbols is a variable?

v

ASCII is a character-encoding scheme that uses a numeric value to represent each character. For example, the uppercase letter "G" is represented by the decimal (base 10) value 71. A partial list of characters and their corresponding ASCII values are shown in the table below. ASCII characters can also be represented by hexadecimal numbers. According to ASCII character encoding, which of the following letters is represented by the hexadecimal (base 16) number 56?

the gate will be TRUE (or ON) when both A and B are TRUE (or ON)

An AND gate is an electronic component that takes two inputs, A and B, such that

the gate would be TRUE (or ON) when either or both A and B are TRUE (or ON).

An OR gate is an electronic component with two inputs, A and B, such that

A check sum is a type of error detection in which each transmitted message is given a numerical value based on the number of set bits in the message. A check sum can tell if an error can occurred because the numerical values will be different, but it can not tell where the error occurred.

Another type of error detection is a check sum. Research what a check sum is and then describe it in your own words. Can a check sum identify where an error occurs?

-A cloud application -An Integrated Development Environment (IDE) -A programming language

App Inventor is an example of

Verically

By default, when you add components to the App Inventor Viewer they are laid out ___________.

general

Complete the following definition: An abstraction is a ____________ representation that stands for some collection of individual instances.

The tag 'school' would now be associated with Bowdoin College instead of Trinity College

Consider the following depiction of the contents of a TinyDb for an app. Tags | Values school | Trinity College trinity | Trinity College college | Amherst College university | Harvard And suppose your app just executed the following block: [call 'TinyDB1' .StoreValue tag{"school"} valueToStore{"Bowdoin College"}

24

Consider the following pseudocode algorithm. Set P to 1. Set N to 4. Repeat while N > 0: Set P to the result of multiplying P by N. Subtract 1 from N. Print P What result would be printed?

Saying that JPEG is a lossy compression technique means that some of the data of the picture is lost during compression. This does affect the quality of camera pictures, but since the human eye can't perceive the data loss the picture looks fine.

Describe what it means to say that JPEG is a lossy compression technique and whether or not it affects the quality of camera pictures

- Languages - Designer - Maps - Computer Science

Examples of abstraction can be found in which of the following?

The error card trick used a parity scheme because it added a bit to each string of bits in order to make the number of 1's in each row and column even. Therefore, it was an even parity scheme (the parity bit is set to 1 if the number of 1s in the data bits is odd, thereby making the number of 1s in the byte an even number).

Explain how the error card trick from Lesson 3.8 uses a parity scheme. Was it an even or odd parity scheme?

*Error detection* is the process of a computer identifying an error (mistake) in the transmitted code, and *error correction* is the reconstruction of the original data. In the video, 3 parity bits were added to the end of each byte so that the computer could recognize where the error occurred and then flip the "bad" data bit (found at the intersection of two incorrect parity bits), thus making the code correct again.

Explain in your own words the difference between error detection and error correction. Describe how the error correction process used in the video above allows the computer to fix errors

This would find the current value of X and then add 1 giving X a new value. If the current value was 10 and this was executed, the new value would be 11

Explain the meaning of the statements shown here, both in AP CSP pseudocode and App Inventor. For example, suppose the variable X has the value 10 before the statement is executed. What value would it have after the statement is executed.

The bit in row 4 column 4

Find the flipped bit. For this table, identify the bit that was flipped.

1 0 0 1 1 1 1 1 0 0 1 1 0 1 0 1

For this 3 x 3 table of bits, which of the choices below would be the correct 4 x 4 table for being able to detect when bit is flipped. 1 0 0 1 1 1 0 0 1

0100 0001 is a binary sequence that can be used to represent a hex of 41 (magenta), a decimal of 65, and the character "A". One can interpret its different values by using the binary sequence in different ways! If it is used in an image it will represent the color magenta, if it is used in a spreadsheet it will represent the number 65, and if it is used in a text message it will represent the letter "A"

Give a specific example of a binary sequence that can represent more than one type of data -- e.g., a number, a color, a character -- and describe how to interpret its different values.

high-level languages must be translated by software programs into low-level machine languages before then can be run on a computer

High-level vs. low-level language

- Condensing - Simplifying

In Computer Science, the process of abstracting also means:

event

In an App Inventor App, shaking the phone is a

0110 1111

In an even parity scheme what would the parity bit be for the binary string 110 1111?

F

In an odd parity scheme the binary string 1010 0011 would be detected as containing an error. T or F?

1001 1110

In an odd parity scheme what would the parity bit be for the binary string 001 1110?

The word "Chair" itself

In general, which of the following is the most abstract when it comes to talking about chairs?

List

In order for this block to work, the global destinations variable must be what type of data (number, string, list, etc.)?

f you used a constant, it would keep reverting to that value rather than the Paint Pot project where you can increase and decrease the dotsize 1 each time you push the buttons.

One aspect of abstraction is that it helps to reduce details to focus on what's relevant. How does the use of a variable, such as dotsize, instead of a value, such as '5', help to reduce detail and focus on what is essential in this program.

- easy to read - not a programming language - a mixture between a natural language and a programming language

Pseudocode is _____

True

T or F: A variable is an example of a data (or structural) abstraction.

False

T or F: Event driven programming means that the program through a sequence of steps in order upon execution of the program until the program reaches the end.

True

T or F: Ftp is one component of the Internet

False

T or F: Moore's law is a principle that states that the number of transistors per square inch on integrated circuits has tripled every year since the integrated circuit was invented.

False

T or F: The Internet was invented by Tim Berners-Lee

True

T or F: The World Wide Web is a system of interlinked hypertext documents using the http protocol

- is a system of interlinked hypertext documents - uses the HTTP protocol - was invented by Tim Berners-Lee

The World Wide Web is

10, 8, 16

The binary number system is base 2 and has 2 digits. How many digits do the decimal, octal and hexadecimal system have?

Input A must be 'true'

The figure below shows a circuit composed of two logic gates. The output of the circuit is true.

- is a network of networks - connects devices and computers around the world - is based on the internet protocol suite

The internet _______

True

True or False. The symbol for an AND gate is more abstract than the truth table that defines its behavior.

False

True or False. The symbol for an OR gate is less abstract than the circuit diagram that defines its behavior.

True

True or False: A horizontal arrangement allows buttons (and other components) to be placed side-by-side in the user interface.

True

True or False: It is possible to have an empty list -- i.e., a list with no elements.

True

True or False: One of the main characteristics of an abstraction is that it simplifies a complex phenomenon by leaving out the irrelevant aspects.

True

True or False: Two examples of abstraction in Computer Science are Data Abstraction and Procedural Abstraction.

False

True or False: When printing a document the printer driver sends the document to the CPU which in turn sends the document to the printer to be printed. This is an example of the computer's hardware sending information to the computer's software.

False

True or False: the internet and the world wide web are the same

false

True or False: the symbol for an OR gate is less abstract that the circuit diagram that defines its behavior.

False

True or false: The blocky maze language is an example of pseudocode

- using a variable instead of a specific value makes an app more generally useful. - a variable is an abstract symbol that can represent lots sof different values

Using a variable is an example of abstraction because

- a variable is more general and more abstract than a specific value such as 5. - using a variable instead of a specific value makes an app more generally useful. - a variable is an abstract symbol that can represent lots of different values

Using a variable is an example of abstraction because...

A filename extension is the 3 letters after the dot at the end of a filename. They are used to indicate how the contents are to be interpreted

What are filename extensions? What are they used for?

There are some limitations to using parity bits. My research shows that one of the main limitations is that a parity bit is only guaranteed to detect an odd number of bit errors, meaning that if there are 2 errors in a byte the parity detection will think the byte has no error. Another limitation is that parity bits can only tell if there is an error in the way the data was transmitted - they have no way of telling if there was an error in the code from the get-go.

What are some of the limitations of using parity bits for error detection?

3, 2

What does the following AP CSP pseudocode display? Remember to trace through the code keeping track of the values in a and b after each line of code. a ← 1 (Set a to 1) b ← a (Set b to the current value of a) b ← b + 1 (Add 1 to b) a ← a + b (Set a to be the current value of a + b) DISPLAY(a) DISPLAY(b)

.aia

What filetype would your App need to have in order to let a classmate import and edit it?

A model is a representation of a photograph in bits.

What is a model

A lossless representation is one that allows exactly the same image to be rendered (no data lost) and a lossy representation is one that allows an approximation of the same image to be rendered (some data lost). Lossless representations are nice because no data is lost, but that makes the file size larger and can make it take longer to be interpreted. Lossy representations have smaller file sizes and can be interpreted in a horter amount of time, but the quality of the document is lesser since some data is lost.

What is lossless representation? What is lossy representation? What are the trade-offs in using each representation?

Metadata is information about an electronic document. An example is the file name or the "last modified date" of the file.

What is metadata? give an example

A printer

What is not an example of software?

Steganography is the art of sending secret messages in imperceptible ways. It is used for including secret (but decipherable) messages along with other data so that only a number of specific people can read the secret message.

What is steganography and what is it used for?

The picture that appears on the device when you install the app

What is the app's icon?

1110 1000

What is the binary representation of the decimal number 232?

875

What is the decimal value of the binary number 0011 0110 1011?

B

What letter of the alphabet would be represented by the following set of numbers representing its RLE compression? 1, 4, 2 1, 1, 3, 1, 1 1, 1, 3, 1, 1 1, 5, 1 1, 1, 4, 1 1, 1, 4, 1 1, 1, 4, 1 1, 5, 1

The StoreValue block stores the name "Mary" under the tag "name". So GetValue will retrieve "Mary" from the TinyDb and assign it to global variable userName.

What value would the global variable userName have after the blocks shown here are executed?

The second StoreValue block stores the name "Bill" under the tag "Name", with an uppercase 'N'. Because tags are case sensitive, there are now two values stored in the database, "Mary" is associated with the tag "name" and "Bill" is associated with the tag "Name". So GetValue will retrieve "Mary" from the TinyDb and assign it to global variable userName.

What value would the global variable userName have after the blocks shown here are executed?

In order to delete a document so that it could be read by anyone else, you would have to delete it and then execute an "Empty Trash" command, which writes over the old data, effectively obliterating it.

What would you have to do to delete a document from your computer so that it could not possibly be read by anyone else?

A raster image is an image representation based on a division into pixels and ASCII is a collection of 8 bit codes used to represent a string of symbols/letters.

What's the difference between a raster image and an ASCII representation of a text document?

Media drawer

Which Palette drawer (folder) contains the Player component?

To carry out, or process, the instructions in a computer program

Which describes the primary function of the CPU?

- relieves users from having to backup their own data and information - makes it easier to share information - users can access information that is on the cloud from anywhere that has an internet connection

Which is the following are advantages of cloud computing?

- Button - Label - Player

Which of the following are components?

- CPU - Main memory - Integrated circuit - Flash drive

Which of the following are examples of hardware?

- It stores data. - It is called RAM, short for random access memory. - Any data stored in main memory disappears when the computer loses power.

Which of the following are true statements about a computer's main memory?

To carry out, or process, the instructions in a computer program.

Which of the following best describes the primary function of the CPU?

- A button that appears on the screen - An audible click that happens when the user taps the button -An error message that appears when something goes wrong. -The color of the app's background screen

Which of the following elements would be considered part of the user interface (UI) for an app?

Printer

Which of the following is NOT an example of software?

It is the same thing as long term memory

Which of the following is NOT true about a computer's main memory?

It is an executable program

Which of the following is NOT true about pseudocode?

There are trade-offs involved in choosing a compression technique for storing and transmitting data

Which of the following is a true statement about data compression?

Twitter, G-mail, Facebook, Dropbox

Which of the following is an example of cloud computing application?

Windows Operating System

Which of the following is not an example of hardware?

Algorithms can be written to solve every problem.

Which of the following is not true about algorithms?

ClearButton

Which of the following is the best name for a button whose function is to clear another component?

The app plays a sound clip

Which of the following would NOT be considered an event on your smart phone or tablet?

ButtonRefresh RefreshButton

Which of the following would be a good name for a button whose purpose was to allow the view to refresh the screen?

userName

Which of the following would be a valid App Inventor variable name?

- user taps on the screen - the phone receives a text message - the phone's location changes - the phone's internal clock ticks

Which of the following would be considered an event on your smart phone?

1, 3, 1 0, 1, 3, 1 0, 1, 4 0, 1, 4 0, 1, 3, 1 1, 3, 1

Which set of numbers would encode the letter "c"?

Fill Parent

Which value would you set the Width property to if you want your component, e.g., a Button, to fill its container

[Set global dotsize to]{10}

[intialize global "dotsize" to]{5} Which of the following blocks would you use to change the value of dotsize?


Kaugnay na mga set ng pag-aaral

Ch 3 - Job-Order Costing: Cost Flows and External Reporting

View Set

Xcel Solutions IN Life Insurance Final Exam

View Set

Chapter 8: Structuring Organizations for Today's Challenges

View Set

AP Psychology Kohlberg/Erikson (Stages of Morality)

View Set

ECON 510 - Exam 3 (Final Exam) - Ch. 7

View Set

Transitions Chapter 7: Legal Dimensions of Nursing Practice

View Set