CS101: Introduction to Computer Science
Saylor.org
1.2.2 Programs and Processes
Lecture Questions
1) What component of a computer system is directly responsible for running a program?
a. The processor
2) When you click a hyperlink on a Web page and your Web browser (a computer program) finds and displays a new page. About how many tiny electronic operations does t processor perform in doing this?
a. About 100,000
a. Yes
4) Fill in main memory starting at address 0 with the machine instructions to control the toothbrush. Copy and paste from the list of machine instructions.

5) Will the toothbrush stop immediately when the switch is turned off?
a. no – it will do one left and one right first.
6) Say that a computer has four billion bytes of memory and that memory is entirely filled with a single program. Each instruction is one bye long, and the processor can execute one billion instructions per second. How long will the program run if execution starts with the first byte and there are no loops in the program?
a. 4 seconds.
7) Say that you are looking at two different processor chips. The first processor has twice as many types of machine operations as the second chip. Is the first processor necessarily the best one?
a. No. All processors can do the same things as the other ones. The smaller processor might be faster simpler and better designed.
8) Say that a corporation pays programmers $50 an hour. Will the corporation want programmers to program in machine language or a high level language?
a. definitely a high level language! It is much faster.
9) Say that a source program has been translated to an executable program. The executable program has been run a few times and the programmer decides to make a change to the program. Where is the change made? To the source program or the executable program?
a. The source program.
translator=compiler
10) Can the processor directly execute the machine language that the program has been translated into?
a. yes
For commercial software like games and word processors, the machine code is the product that is sold to the user. The user does not get a copy of the source program.11) Say that you have a source program written in C. You copy the program onto the hard disk of a Pentium-based computer and also copy it onto the hard disk of an Motorola-based computer. What must you do so both computers can execute the program?
a. Have the correct compiler/translator for each type of processor that is also compatible with C.
12) Say that a corporation pays programmers $50 an hour to write application programs that will run on both Apple and Windows computers. Will the corporation want programmers to program in Java or in some other high level language?
a. Probably in Java. Unless there is another equally portable language they have in mind.

13. An interpreter runs directly on the processor. What type of instructions must an interpreter consist of?
a. machine instructions.
14. Do you think that a BASIC source program could be translated into an executable file of machine instructions?
a. Yes.
15. Is it always important for a program to run as fast as possible?
a. No, not always. They need it done on time, but on time means fast enough.






