Thursday, December 19, 2013

Whitney Mergist CS101: Introduction to Computer Science Saylor.org 1.2.2 Programs and Processes Lecture Questions

Whitney Mergist
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











3) When they are running, are machine language programs located in the main memory along with data?
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.

Tuesday, December 17, 2013

CS101: Introduction to Computer Science Saylor.org 1.2.1 Hardware vs. Software

Whitney Mergist
CS101: Introduction to Computer Science
Saylor.org
1.2.1 Hardware vs. Software

Lecture Questions

1) What do you think about the movie The Wizard of Oz?

a. I love it. My favorite song is “Somewhere over the rainbow.” However, I found that I like it more now than I did growing up because I saw Wicked when Broadway traveled to Salt Lake City.

2) Imagine that you have a copy of the book Tom Sawyer. You tear it to pieces and push the shreds through your garbage disposal. (It was probably assigned reading.) Have you destroyed the novel Tom Sawyer?

a. Yes and no. I have destroyed a copy of the novel Tom Sawyer, but not the novel as an entity. (The answer given was no)

3) Question 3: Is a mouse an input or output device?

a. Input device



4) Say that a computer adds 13 to 27. Where does this activity take place?

a. The processor

5) Which is fastest? Main memory or secondary memory?

a. Main memory

6) Imagine that you are using a computer to write a book report on Tom Sawyer. A) Where is the word processer program that you are running located? B)Where are the characters you have typed?

a. Main memory (copied from secondary memory, but in main memory while running)

b. Main memory (not in secondary memory until save)

7) Say that you have purchased the game Doom IV and have installed it on your computer. The game consists of A) a program that controls the action of the game and B) data (the images and other information). After installation where is each of these parts located in your computer system?

a. On the hard disk

b. On the hard disk

8) Do you think that data transfer from the network is slower or faster than from main memory?

a. Slower

9) Is a game controller an input device or an output device?

a. Input

10) Your automobile engine is controlled by a computer. Do you think that this computer has:
Input devices?
Output devices?
Main storage?
Secondary storage?

a. Yes to all except secondary storage. A hard disk wouldn’t last long installed next to a car engine

11) Which of the following can be saved on a disk?

A game program - YES

Accounting data (numbers) -YES

Audio data - YES

Graphics data -YES

Digital photographs -YES

Video data – YES



12) (Thought question:) Imagine that you have just turned on your computer and have not yet started any application. Are any programs running?

Yes the operating system is running

13)

(Review:) What component of a computer system holds the operating system when the computer is not running?

Hard disk

14) When an application stops running, do you think that it is copied from main memory back to the hard disk?

a. No – the hard disk already has a copy

15) Can a local area network be implemented using radio waves instead of cables?

a. Yes

16) When two computers communicate must they both use the same protocol?

a. Yes

17) With so many computers connected to the Web, do you suppose that there is trouble giving each computer its own address?

a. Yes

18) Can programs, as well as data, be exchanged over the Internet?

a. Yes. The hardware doesn’t distinguish between the information types.

19) When you click on a hyperlink will the URL in the address box change?

a. Yes.


Lecture Clippings:






Chapter 1 Quiz Results