Write short essay responses to these questions:
(a) Give me one example of a task for which you would not write a program and give me another example of a task for which you would write a program.
(b) What’s the difference between an array, a matrix, and a tree? Give an example where we have used each to represent some data of interest to us.
(c) What is dot notation and when do you use it?
(d) Why is red a bad color to use for chromakey?
(e) What’s the difference between a function and a method?
(f) Why is a tree a better representation than an array for files on a disk? Why do you have many directories on your disk, and not just one gigantic one?
(g) What are some advantages that vector-based graphics have over bitmap graphical representations (like JPEG, BMP, GIF)?
(a) Note: The important things for an answer to include are examples based on things that are difficult for programs and things that are easy. For example: programs can do simple tasks, programs can repeat tasks exactly, and programs can create interactive experiences. That means that good examples to use programs for would be for a program to search through a lot of text, to alter a sound file, or to serve as an adventure game. It is much harder for programs to complete tasks that cannot be described exactly, to engage with non-digital materials, or to handle extremely specific, non-generalizable tasks. Activities that would not make good programs then would be things like filling out physical forms, writing a short story, or answering questions for an intro to programming class.
(b) The primary difference between all three is that they are different ways of storing data; they are different data structures. The difference between an array and a matrix is that an array is a single sequence of elements of the same type, while a matrix is a twodimensional array. A
tree is different from an array or matrix as it is a hierarchical organization of information rather than a sequence. We have used arrays to represent strings, matrices to represent pictures, and trees to represent file structure.
(c) Dot notation is calling a method by including a period between an object and the method. For example “foo.bar()” where foo is the object and bar is the method. It is used in calling an object’s methods.
(d) Red is a bad color for chromakey as many individuals have significant red pigmentation in their skin.
(e) Methods are like functions except that they’re not globally accessible, they’re linked to specific element types.
(f) A tree is a better representation than an array for files on a disk due to it being much better in terms of organization and finding desired files. If there was just one gigantic directory then a user would have to search through all of their files to find a single one.
(g) Vector-based graphics can be scaled to different sizes without loss of quality, and they can also take up much less memory then a similar high-quality image.
You might also like to view...
The ____________ data type is used to store individual characters.
a. bool b. string c. char d. int
Name three goals for well-written software.
What will be an ideal response?
Convert the following numbers from decimal notation to scientific notation. Round the result to five significant digits:
1.) 123456.7 2.) 12345.67 3.) 1234.567 4.) 123.4567 5.) 12.34567 6.) 1.234567 7.) 0.1234567 8.) 0.01234567 9.) 0.001234567 10.) 100000 11.) 1000000000 12.) 1000000001 13.) 0.000001234567 14.) 0.00000123
The following least-squares prediction equation is based on college GPAs (y) and SAT scores (x) in English:If a student scores 600 on the SAT, predict the student's GPA.
A.
B.
C.
D.
E.