.. _cosc1336-exam1-review: Exam 1 Review ############## The first exam will consist of a written part and a lab part. The written part is closed book, and consists of short-answer questions covering the concepts we are studying. I will post an open-book lab problem for the exam on Tuesday evening. You will have until midnight on Thursday, Oct 11 to post your lab problem on GitHub. Review materials **************** These notes contain some sample questions for you to try out before you take the first exam. Note that most of these are in the form of multiple choice/True-False, and the actual exam will not be that kind. I will ask questions on the important concepts we have been studying, and you get to explain them to me. I am hoping that working through these questions will get you ready to explain those concepts. Here are the sample questions: Introduction ============ 1. A precise list of instructions we want a computer to follow is called a _____ 2. Computers are very smart * True * False 3. Computer programs are written in some programming ______. 4. A computer follows a precise list of ___________. 5. Python is interpreted, while C++ is compiled, what is the difference? * Interpreted is faster * Compiled is faster 6. The rules that define how programs are actually written are called ________. 7. A properly written statement in a programming language has meaning. This is also called ________. Control Structures ================== 8. A ``structure`` is a programming construct with a single input and a single output * True * False 9. All of these are basic structured forms except: * Sequence * Decision * Assignment * Loop 10. The ``while loop`` processes the loop body at least once * True * False 11. We can write a decision structure which omits the ``False`` process * True * False Binary Numbers ============== 12. The characters we use for our normal numbers are called * Numbers * Symbols * Digits 13. The number system that uses ten symbols is called the _______ system * base ten * normal * decimal 14. The number system used by computers that has only two symbols is called the ______ system * base two * binary * discrete 15. The first electronic computer was named: * HAL * IBM * ENIAC * MAC 16. What is the next number in the binary number system after 11? * 12 * 100 * 110 17. What is the decimal number equivalent of the binary number 101? * 11 * 3 * 5 * 6 18. A transistor is just a fancy electronic _______ 19. Computers can manipulate any kind of data we can * encode as binary numbers * invent a device to attach to the computer to read the data * convert into decimal symbols Hardware Overview ================== 20. We store programs and data in the computer's ________ 21. The electronic device that was invented in the early 1950's that let computers get very small is a _______ 22. The computer processes instructions as the system _________ ticks 23. Can you name the sequence of actions taken by the processor as it runs each instruction in your program? * true * false 24. In the Pentium computer eight bits is called a _______ 25. A large series of bytes each numbered from zero to some large value is called the _________ 26. The two basic kinds of memory we find in a computer are read/write and read only * true * false 27. When we turn off the power to a computer, the program remains in memory. * true * false 28. The memory we use to store programs while the computer is turned off is called flash memory * true false Problem Solving =============== 29. When we start working on a problem, we need a good ________________ statement 30. The first thing we do in solving the problem is to _______________ the problem 31. The fancy term for the series of steps we want a computer to follow to solve a problem is an ________________ 32. At any point in time while a computer is working through your program, we say that the program is in some specific ____________ * state * country * computer 33. The use of proper indentation in a program is called good program ______________ 34. Since modern programming languages can have blanks just about anywhere, we do not need to worry about program style. * true * false 35. The rules for writing a program are different for different programming _______________ 36. You should understand your programming language well enough to be able to manually walk your program through its steps. * true * false 37. Before you can be sure your program works properly, you should ____________ your program. Simple Python functions ======================= 38. A function is a fancy name for a box of code we can use over and over. * true * false 39. Functions must return a value to the caller. * true * false 40. The items between parentheses in a function definition are called ________ * variables * numbers * parameters 41. Can you explain how we made a box on the graphics screen using our graphics functions? * true * false 42. We call the program construct "sqrt(x)" a _____________ Data, variables and simple expressions ====================================== 43. Can you explain why do we use names for data in our programs? * true * false 44. When we create a new variable, we need to _________________ it so it has a know value. 45. The "+" symbol is called a mathematical _______________ 46. The "*" symbol identifies the mathematical ________________ operation 47. A number with no fractional part is called an ________________ 48. When the computer sees a variable name in an assignment statement * It uses the value stored in that variable * It asks the user what value to use * It halts since it does not know what to do 49. When Python evaluates "*" * 50, what gets produced? Flow charts and pseudo code =========================== 50. Can you draw diagrams of the three basic structures of programming? * True - good * False - study more! 51. Can you write pseudo code for each of the three basic structures? * True * False 52. In IPO, the P refers to ________________. Additional Review Material ************************** Here are more sample problems you should study before you take the first exam. There might be a few problems we discussed in class that are not included in the notes. You should look them up, either in the text, or by doing a bit of research. .. include:: P02.inc .. include:: P03.inc .. include:: P04.inc .. include:: P05.inc .. include:: P06.inc