Download CPSC 217 Midterm Exam | Latest Update | 100% Correct | Verified Answers 2024 and more Exams Advanced Education in PDF only on Docsity! CPSC 217 Midterm Exam | Latest Update | 100% Correct | Verified Answers 2024 A boxy device with a typewriter-like interface that stores and processes information. - Correct Answer-"Boring" Definition of a Computer A device that contains computer programs or other data, and pursuant to computer programs (performs logic and control, and may perform any other function.) "Computer program" means data representing instructions that, when executed in a computer system, causes the computer system to preform a function. - Correct Answer- Criminal Code of Canada" Definition of a Computer An electronic device that accepts information in digital or similar form and manipulates it for a result based on a sequence of instructions. Another possibility: 1. One who computes 2. A tool that receives, processes, and presents data. - Correct Answer-UCITA USA" Definition of a Computer : A computer does not need to be electronic - it could be mechanical ,optical or even biological - digital isn't acurate either as it could be dna or quantum data so it is a .......... - Correct Answer-Tool father of the computer -In 1991, a functioning difference engine was constructed from Babbage's original plans for a digital programmable computer. - Correct Answer-Difference Engine (Charles Babbage) - A difference engine is an automatic mechanical calculator designed to tabulate ______________________. (~1822) - Correct Answer-polynomial functions _________________________ - Mathematician and writer - Worked with Charles Babbage on computer difference engine -Maybe the first programmer (at least first evidence of) - Early philosophy of computer science (The effects of technology on people) - Correct Answer-Ada Lovelace Modern Computers Integrated Circuits (1959) patent by Robert Noyce. Co-inventor of integrated circuit. - Considered founder of silicon valley, his company spawned _______________________-. - Correct Answer-Intel/AMD/National Semi conductors Modern Computers William Shockley was the manager of a research group at Bell Labs that included John Bardeen and Walter Brattain. The three scientists were jointly awarded the 1956 Nobel Prize in Physics for - Correct Answer-"their researches on semiconductors and their discovery of the transistor effect." Major components of a modern desktop computer - Correct Answer-Central processing unit (CPU) Main memory Secondary storage devices Input and output devices the part of the computer that actually runs programs - Correct Answer-•Central processing unit (CPU): Where computer stores a program while program is running, and data used by the program Quick but disappears when off Can hold data for long periods of time Programs normally stored here and loaded to main memory when needed - Correct Answer-•Main memory: Random access (volatile) memory (RAM) Hard Drive (long term memory) _ - "The complexity for minimum component costs has increased at a rate of rBody and Brainoughly a factor of two per year... Certainly over the short term this rate can be expected to continue, if not to increase. Over the longer term, the rate of increase is a bit more uncertain, although there is no reason to believe it will not remain nearly constant for at least 10 years." - Correct Answer-Moore's Law 1965 - Modern ________ are based off of Von Neumann Architectures (1945). Stored-program architecture (versus ENIAC types where you'd input program by physical configuration each time) - Correct Answer-CPUs One test for determining if an artificial intelligence has been successfully created • It includes: test participants as well as a candidate artificial intelligence, a person who can also answer the same questions as the candidate intelligence • Test participants ask a series of questions (e.g., scientific problems, questions about popular culture etc.) of another person and a candidate artificial intelligence. If the test participants cannot tell the difference between the two, then an artificial intelligence has been successfully created. - Correct Answer-The Turing Test - Can appear on the right-hand side of assignment statements - A value or a variable all by itself is a simple expression - Correct Answer-Expression Precendence: 1. () 2. x**y 3. -x, +x 4. x*y, x/y, x%y, x//y 5. x+y, x-y 6. not 7..and 8.or 9.= What is the output of the following expression? 16-2*5//3+1NOT - Correct Answer-14 BOSAMDSA What is Data? Data: raw facts, representation of information, no context. __________________: The translation of information into data because computers process data not information. - Correct Answer-Encoding Standard encoding scheme called _______________ - American Standard Code for Information Interchange - 7 bits per character - Includes printable characters - Includes "control characters" that impact formatting (tab, newline), data transmission (mostly obsolete) - Layout seems arbitrary, but actually contains some interesting patterns. - Correct Answer-ASCII Limitation of ASCII - only supports ____________ character set - No support for accents, additional character sets - Correct Answer-Latin ____________ - Variable length - 1,2,3 or 4 bytes per character. - Compatible with ASCII - Consider each byte - Left most bit is 0 - Left most bits are 110? 2 byte character - Left most bits are 1110? 3 byte character - Left most bits are 11110? 4 byte character - Correct Answer-UTF-8 Encoding Images - _____________ images : "line work" image is encoded as a collection of geometric primitives such as points, lines, curves. - Correct Answer-Vector Encoding Images - ____________ images : constructed from a grid of pixels (picture elements), where each picture is assigned a color. - Correct Answer-Raster How do we represent color as a sequence of bits? Can represent almost any color as a combination of some red, some green, and some blue. Typically use a scale from 0 (no light of that color) to _______ (full on for that color). 16 million different possible colors. To represent an image: 3 color components for each pixel. - Correct Answer-255 Videos - Raster image storage formats like jpg heavily use '____________________' to reduce storage size. -> Basic ideas, reduce quantity of colours stored, and group of ideas of 'where colours are' to store less information. - Video compression works similar but since video is a sequence of frames where each frame is an image, they also make use of reducing data by grouping idea of 'colours stay the same and where' across multiple frames. -> great example of compression failure : confetti. -> when confetti is in image, the colour of spot changes every frame and nearby spots are different each frame. -> this means more info is needed per frame, as a result at the same data rate, the image quality will go down (boxy artifacts will appear, or even decoding breaks down) -> this is the same reason sports struggle with compressed video. - Correct Answer- compression Namespace - is a declarative region that provides a ______________ to the identifiers (the names of types, functions, variables, etc,) inside it. Whenever you declare a variable it exists within a namespace. -Whenever python sees you use a variable, it looks with this storage area for the variable name you use and finds out what it is attached to. dir() returns to use all the things in the current namespace. - Correct Answer-scope ____________-box testing - Test the program without looking at the source code -> Test are generally functional/behavioural - Correct Answer-Black ___________-box testing - Design test cases for the program by looking at its source code - Tests are generally structural - Correct Answer-White ____________-Box Test Coverage How do we thoroughly do the cases test the code? - Condition Coverage: Every decision point in the program is executed - Statement Coverage: Every statement in the program is executed. - Path Coverage: Every possible path through the program is executed. - Correct Answer-White _____-test loop 1. Initialize the loop control 2. Check the condition -False: Stop the loop, Skip the body go to the rest of program -True: Execute the body of the loop 3. Update the loop control 4. Repeat from step 2 Condition is checked before the body is executed - while and for - Correct Answer-Pre - executes as long as some condition is true - a pre-tested loop (loop condition is tested before the loop executes the first time) - when it is not known how many times to repeat while condition: (indent) body - Correct Answer-While loop indeterminate While Loop Example userinput=int(input('Please enter a number to add to sum')) sum=0 while (userinput !=0) (indent) sum=sum+int(userinput) (indent)userinput=input('Plz enter a number, '0' to end') Here 0 is a _______________ value (a value that indicates loop completion) - Correct Answer-sentinel (_____________________) - A counting loop: Typically used when we know how many times we need to perform a task in advance. a pre-tested loop for variable_name in list: (indent) body - Correct Answer-For loop determinate (start, end, step) - Correct Answer-Range