AP Computer Science Principles Unit 4, Quiz 2 (Edhesive)

0.0(0)
studied byStudied by 0 people
0.0(0)
full-widthCall with Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/6

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No study sessions yet.

7 Terms

1
New cards

Consider the following procedures for accessing and modifying the color channels of an RGB pixel.

RED (pixel): Extracts the red value from the color of pixel

GREEN (pixel): Extracts the green value from the color of pixel

BLUE (pixel): Extracts the blue value from the color of pixel

SETCOLOR (pixel,r,g,b): Replaces the red, green, and blue values of pixel with new values (r, g, and b, respectively)

Using the above procedures, a programmer has written the following code segment to modify image, an array representing the color values for each pixel within an RGB image.

FOR EACH pixel IN image { r = 255 - RED(pixel) g = 255 - GREEN(pixel) b = 255 - BLUE(pixel) SETCOLOR (pixel, r, g, b) }

Which of the following best describes the resulting image?

All of the colors of the resulting image will be inverted, like a negative, of the original image.

2
New cards

Which of the following statements about lossy and lossless compression is true?

Lossless compression will allow a file to be compressed into a smaller form, but will not sacrifice the information needed to put it back together in its entirety.

3
New cards

When web developers specify color values for text or backgrounds, they often represent RGB (red-green- blue) colors using a six-digit hexadecimal (base-16) value, such as #BF5700, in which the first two characters represent the red component of the color, the middle two characters represent the green component, and the final two characters represent the blue component. Each of these color components can be assigned one of 256 different values (decimal: 0 - 255, hexadecimal: 00 - FF ), with lower values representing darker shades and higher values representing brighter shades.

You want to configure the text on your blog to use a slightly darker shade of purple than the one you have seen used on another website. The purple used on that site has an RGB value of #7F20FF.

Which of the following RGB values would produce the darker shade of purple that you desire for your blog?

#3F107F

4
New cards

A music artist has just finished creating his most recent single and it is now ready for release. The artist loves when others remix and reuse his harmonies, melodies and lyrics in their own unique ways, so he is going to publish it online using a Creative Commons license. What license should he use if he is asking that his original work is acknowledged and that the person originally remixing his project, along with anyone else subsequently remixing that work, does not make any money from the new work?

Attribution Non-Commercial Share Alike

5
New cards

A summer camp offers a morning session and an afternoon session. The list morningList contains the names of all children attending the morning session, and the list afternoonList contains the names of all children attending the afternoon session. Only children who attend both sessions eat lunch at the camp. The camp director wants to create a lunchList, which will contain the names of children attending both sessions.

The following code segment is intended to create lunchList, which is initially empty. It uses the procedure IsFound (list, name), which returns true if child is found in list and returns false otherwise.

FOR EACH child IN morningList { }

Which of the following could replace the missing code so that it works intended?

IF (IsFound (afternoonList, child)) { APPEND (lunchList, child) }

6
New cards

When digitizing a recording of a musical performance, which of the following strategies will result in a more accurate digital representation of the original music?

Select two answers.

Increasing the bit depth of the music being digitized

AND

Increasing the sampling rate of the music being digitized

7
New cards

The following procedure controls the movement of a triangle shaped robot on a grid. The robot is initially in the middle of the grid facing toward the bottom.

Which of the following shows the correct final location of the robot in the grid if the procedure move was called 5 times with the values of left right left forward left respectively?

Highest Arrow pointing left