SOLUTIONS ICS20 General Knowledge Review Questions PART A 1. List 5 ways to prevent data loss. 1. 2. Save once on a hard drive and then again on a different backup drive. When all else fails, you can always restore your data from a back-up--if you made a back-up of your data! Investing in a HARD DISK BACKUP IS A GOOD IDEA. 2. Always save every 5 minutes. (You do not EVER want to type more than 5 minutes worth of work over again should an unexpected problem occur!) 3. Use antivirus software and keep it up to date. 4. When you save your files on your computer, organize those files into folders or directories (ie. Family letters, finances etc.) so that you can easily find your files in the future. If you tend to forget the names of your files you can place the path and the file name in a small font at the bottom of your document. 5. Print out one hard copy of important documents. 6. Use surge protectors. Power surges and spikes are sudden jolts of electricity. They come in to your computer through the electrical line, telephone line, serial cable, parallel cable, or network connection cable attached to your computer. Power problems can cause data loss, or they can fry!!! computer components such as the processor, motherboard, RAM, hard drive, and so forth. :-( You should have all your computer equipment, the main box and all the extras, plugged into surge suppressors. 7. You may password protect any file that you save on a network or public drive. Fill in the following chart for our machines in the computer lab 3. Imagine that a user has a program open at a workstation in our classroom and that workstation is unexpectedly disconnected from the school network and the Internet. Where should the user save her work? USB key is best 4. Fill in the following chart Term byte Number of bytes 8 BITS 1 BYTE KB APPROX. 1000 BYTES KILO -THOUSAND MB APPROX. 1000 000 BYTES MEGA- MILLION GB APPROX. 1000 000 000 BYTES GIGA- BILLION TB APPROX 1 000 000 000 000 BYTES TERRA -TRILLION 5. Computer hardware refers to the actual equipment, machines, and physical devices of a computer system. List 5 items that a computer system usually contains. CHIP OR PROCESSOR / RAM OR MEMORY / HARD DISK DRIVE AND DISK / FAN / KEYBOARD / MOUSE / POWER SUPPLY / CD OR DVD DRIVE NETWORK CARD / RIBBON CABLE / SOUND CARD / AUDIO CARD / SPEAKERS 6. The SYSTEM UNIT is the cabinet that contains the computer's working components. 7. An OPERATING SYSTEM is a set of programs that control the resources and components of the computer. It controls the BIOS or BASIC INPUT OUTPUT SYSTEM. It allocates memory also known as RAM and synchronizes hardware components such as the monitor, printer and disk drives. 8. Apps or APPLICATIONS are written by programmers to perform a specific function for the user. 9. The tools used by programmers to create these apps are programming languages. Examples of well-known programming languages include ALICE, JAVASCRIPT, RUBY, PYTHON. 10. RAM (Sometimes called memory when you go computer shopping)is used by the operating system to temporarily store the programs and information which are actively in use. The items stored here are readily accessible to the CPU. This memory is considered VOLATILE OR TEMPORARY because everything stored in it is erased when the computer is turned off. A computer for gaming would need a large amount of RAM. 11. Which of the following is an example of a strong password? Page 4 of 14 a) Password - probably one of the worst passwords you can pick b) 12345678 c) Your passport number d) None of the above Passwords should be long, filled with uppercase, lowercase, numbers and special symbols. 12. You are thinking of a purchasing a laptop for gaming. Specifications are as follows: In the table on the next page, list 4 features that are described and explain why each feature would be preferable for this task. iBuypower Battalion Ultra-Thin M1771 MacBook Pro SPEC DATA: SPEC DATA: Processor Name: Intel Core i7-4700MQ Processor Name: Dual-core Intel Core i7, Processor Speed: 2.4 GHz Processor Speed: 2.6 GHz Operating System: Microsoft Windows 8 Operating System: Mac OS RAM: 16 GB RAM: 8 GB STORAGE: STORAGE: Screen Size: 17.3 inches Screen Size: 13 inches Native Resolution: 1920 x 1080 Native Resolution: 2560-by-1600 Touch Screen: No Touch Screen: No Battery Rundown - Standard Battery: 4:00 hrs:min Battery Rundown - Standard Battery: 6:00 hrs:min Cost:$1859.00 BEFORE TAXES AND SHIPPING Cost:$1859.00 BEFORE TAXES AND SHIPPING Page 4 of 14 Page 5 of 14 1 Device: feature Why this feature would be more suitable. M1771 Battery life LONGER BATTERY LIFE is not an important feature when gaming because the laptop is often connected to a power source. Similarly weight is not a factor here as well. 2 Both devices Price Because the price is similar, this is not an issue. This is a costly kind of laptop to purchase because they need to have a lot of computing power. This would not be true of regular laptops which would be used for student use. 3 M1771 RAM The device with the higher amount of RAM is preferable, because game programs need to work quickly with no hesitations. If you chose the MacBook, you would have to pay for more RAM. 4 M1771 or Screensize The MAcBOOK has clearer resolution, but if you prefer a bigger screen MacBook and then choose the M1771 resolution 13. a) b) c) d) A section of code that checks a condition or computes a value is called a(n): question parameter function none of the above 14. a) b) c) d) To make an object invisible in ALICE, you may: make the opacity of the object = 1 make the opacity of the object = 0 set the invisibility of the object = true none of the above 15. a) b) c) d) Six relational operators exist in Alice. Which of the following represents “greater than or equal to” =< - not valid <= less than or equal => - not valid >= greater than or equal 16. One tool for cutting a set of instructions from one place to another in the editor is to use the _____________. a) trash can b) clipboard c) play button Page 5 of 14 Page 6 of 14 d) file menu 17. a) b) c) d) The keyword(s) _____________ signals the presence of sequential execution DO IN ORDER DO TOGETHER – simultaneous execution IF/ELSE – conditional execution NOW – not an alice word 18. a) b) c) d) Which of the following describes a primitive or built-in method in ALICE? say move a) and b) above none of the above 19. a) b) c) d) One purpose of methods is to _____________. divide a program into small manageable pieces that work together to create a meaningful whole allow two different objects to be instantiated from the same class allow non-interactive code to execute differently each time an Alice world is run create a distinction between built-in Alice objects and modified Alice objects 20. a) b) c) d) A comment in an Alice program is: an instruction that causes an action to take place an explanation of what the program does an expression that holds a value when the program runs A special property that all objects have 21. a) b) c) d) Which statement is an example of a repetition control structure? Do together statement If/Else statement Do in order statement Loop statement 22. a) b) c) d) A boolean value is ____________. a number a string either true or false the value 0, 1, or -1 23. Match each term, appearing in the left column, with its definitions, appearing in the right column. The first answer is done for you as an example. A. B. a step by step list of instructions algorithm features or characteristics of an object ie the snowwoman’s head is pink property C. the time in seconds that an instruction is performed duration D. a list of actions to perform a task method or procedure E. asking a question to produce a result function F. A single “thing” in a virtual world. It has been made according to plan (or class) Page 6 of 14 Page 7 of 14 G. H. I. J. K. L. M. N. O. P. Q. R. S. T. U. V. W. X. Y. Z. AA. BB. CC. DD. object error in a program bug a single line of code instruction a set of instructions written in a programming language code / computer program A 3-D environment that can contain objects. These objects can perform tasks. virtual world One after another sequentially Taking place at the same time as another thing simultaneous The scene which is to be created and the general purpose of the program scenario Change your storyboard into program code implement A pictorial representation of a plan for a program or a movie storyboard The program is efficient and clear elegant A pictorial plan of action which uses standard diagram shapes for different action. flowchart A measure of how visible or invisible an object is opacity A statement that is included in a program which explains the program and gives credit to the author. comment The time when the program is executing or running. runtime When one block of code is completely inside another nested Write a line of code – test it – amend it if necessary test again trial and error These are programming blocks which direct the flow of execution of the program. E..g do together control structures A procedure primarily designed for one object only class-level methods A procedure designed for multiple objects world-level methods A “basket” or place holder for a value which is passed to a procedure e.g. WhichToy parameter The actual value that is passed to a procedure. whichToy = bunny. Bunny is tha actual value which is passed. argument An instance of a class which is placed in a world. object A gallery item class A characteristic of an object property 24. Page 7 of 14 Page 8 of 14 a) If the mummy is closer to the pyramid, what happens when this program is executed? This.mummy thinks “I’m closer!!!!” b) If the pharaoh is closer to the pyramid, what happens when this program is executed? This.pharoah thinks “No- I’m closer!!!!” c) If they are the same distance from the pyramid, what happens then when this program is executed? This.pharoah thinks “No- I’m closer!!!!” Think about how the programmer could make her program work for all possible poutcomes! 25. Put meaningful comments into this Alice program code. Page 8 of 14 Page 9 of 14 Page 9 of 14 Page 10 of 14 26. Why was the detail “as seen by this room” added to the move up and move down commands? The Alice command move up would cause the person to shift up through the axis from her feet to her head. Using the “as seen by the room” causes the character to seem to levitate up. 27. Lists the parameters and their type in the levitate method. whichBiped :object or biped type howFar: decimal type 28. List the arguments and their types in the statements which move Alice up or down. This.Alice is the argument / object or biped type 1.0 is the argument / Decimal type 29. Consider this Alice program Write a textual storyboard to ask the user the simple multiple-choice question and respond to the user’s answer with “Good – you got it!” or “Sorry, the correct response was b.” Which of these is actually a very basic computer? a) a toaster b) a calculator c) a light bulb Note that you will need to use a variable of type textString order to complete this question. Variable userResponse Type textString Page 10 of 14 Page 11 of 14 userResponse getStringFromUser “Which of these is actually a very basic computer? a) a toaster b) a calculator c) a light bulb” if userResponse contentsEquals* “b” then cheshireCat say “Good – you got it!” else cheshireCat say “Sorry the correct response was b.” *Note that if the user uses the term is equal to or == instead of the phrase contentsEquals then the answer would be correct because the is a storyboard and not the actual Alice code. 30. Write the textual storyboard to cause the bunny to move randomly forward or backward, while simultaneously turning left or right. Put your code in a count loop in order to repeat the motion 100 times. The motion does not need to look realistic. No independent leg motion is needed. Make your code as efficient as possible. Count up to 100 Do together bunny move forward (random number from -.5 to +.5 inclusive) bunny turn left (random number from -.1 to +.1 inclusive Page 11 of 14 Page 12 of 14 31. a) Show the textual storyboard needed to create a random integer number between 1 to 5 inclusive Have the user guess the number. Give them 3 tries. Use X as the name of the variable which stores the random integer. Use userRespomse as the variable used to hold their guess. Variable Name X Type Whole Number userResponse Whole Number How it would look in Alice How it would look as a textual storyboard loop 3 times X random whole number between 1 and 5 inclusive Ask the user for a number between 1 and 5 inclusive and store it in userResponse if x equals userResponse then alien says “Correct!” else alien says “Try again” Page 12 of 14 Page 13 of 14 b) Improve your program by using a boolean variable called CORRECT which can be true or false. If they get the answer true then congratulate the user and stop the program. Use a while loop. Set CORRECT to false to begin with. How it would look in Alice CORRECT FALSE // the user has not yet guessed the random number While not CORRECT is true keep looping X random whole number between 1 and 5 inclusive Ask the user for a number between 1 and 5 inclusive and store it in userResponse if x equals userResponse then alien says “Correct!” Correct TRUE else alien says “Try again” Page 13 of 14 Page 14 of 14 32. Your Alice program has a method called flyForward.. A call to this method would be flyForward (6.5) which would cause a bird to fly forward 6.5m. You want to run this method when the user presses the “spacebar” key. Show the textual storyboard needed to describe this keylistener. If spacebar is pressed then flyForward (6.5) Page 14 of 14