You are on page 1of 10

CCOM 3030

Fall 2013
Exam 1B

Instructions: You have 1 hour and 20 minutes to complete this exam. If you finish
early you may quietly leave the room. Please show all of your work if you want to
receive partial credit. Keep your eyes on your own exam. At this time please enter
your name below and initial the bottom of each page. You may begin the exam once
everyone has completed this task and you are instructed to begin.

NAME: _________________________________________ DATE: ________________

Good Luck and Have a Great Weekend!!!

Page 1 of 10 initials _____


CCOM 3030 Fall 2013
Exam 1

True or False (2 pts. each)


Circle the word TRUE or circle the word FALSE. If neither is circled, both are circled,
or it is impossible to tell which is circled, your answer is considered wrong. If the
statement is FALSE, you must correct it to receive full credit. You may not correct the
portion of the sentence that is bolded and simply negating a statement is not sufficient for
full credit.

1. TRUE or FALSE
A bus is a group of parallel wires that carry control signals and data between other
components and serves as the main communication between components.

2. TRUE or FALSE
Putting memory into a particular memory address is considered a WRITE.

3. TRUE or FALSE
A peripheral device is an integral part of the computer.

4. TRUE or FALSE
The monitor is considered a secondary storage device.

5. TRUE or FALSE
Linux filenames are case sensitive.

6. TRUE or FALSE
The hard disk is considered volatile memory.

7. TRUE or FALSE
The “brain” of the computer is considered the CPU.

8. TRUE or FALSE
The command in Linux to rename a file is ren.

9. TRUE or FALSE
Computers store values using the binary number system.

10. TRUE or FALSE


The command in Linux to display the contents of a file page by page is more.

11. TRUE or FALSE


A GUI is a command line interface.

12. TRUE or FALSE


The Linux command to make a directory is md.

Page 2 of 10 initials _____


CCOM 3030 Fall 2013
Exam 1

13. TRUE or FALSE


The command to list the contents of a directory is ls.

14. TRUE/FALSE
If n is an integer variable, the value of the expression n % 6 is always less than 6.

15. TRUE/FALSE
The order in terms of quickest to slowest access of the following components in
your computer is cache, registers, main memory, and hard drive.

16. TRUE/FALSE
A Python program that prints three lines of output must contain three print
statements.

17. TRUE/FALSE
The Linux command grep rep myfile displays all the lines in myfile that
begin with the letters rep.

18. TRUE/FALSE
There are 32 bits in a byte.

19. TRUE/FALSE
Reading from a memory location alters its contents.

20. TRUE/FALSE
If x = 2 and y =3 then y**x is 8.

Multiple Choice (2 pts. each)

Circle the letter of the best choice.

1. Which of the following is an editor?

[a.] UNIX
[b.] ls
[c.] Putty
[d.] vi

Page 3 of 10 initials _____


CCOM 3030 Fall 2013
Exam 1

2. What is the value of the expression 5 * 5 - 19 - 16 % 7?

[a.] 4
[b.] -3
[c.] 0
[d.] none of the above.

3. The notation . (dot) refers to the

[a.] parent directory.


[b.] child directory.
[c.] home directory.
[d.] current directory.

4. Each cell of memory is numbered and that number is considered the memory's

[a.] address.
[b.] block.
[c.] size.
[d.] name.

5. Main memory is called RAM because

[a.] it can Read All Memory.


[b.] it is volatile, like a ram's temper.
[c.] the memory is accessible randomly.
[d.] the computer starts at address 0 and reads every byte until it reached the correct
address.

6. A byte is composed of

[a.] 4 bits.
[b.] 8 bits.
[c.] 16 bits.
[d.] 32 bits.

7. The Linux command to delete a file is

[a.] rm
[b.] del
[c.] pwd
[d.] mv

Page 4 of 10 initials _____


CCOM 3030 Fall 2013
Exam 1

8. Secondary storage is considered persistent because

[a.] the contents of the memory are lost when the computer is turned off.
[b.] it may change at any time without warning.
[c.] the memory may be easily removed from the computer.
[d.] unless problems occur, the memory is not corrupted when the computer is
turned off.

9. The Linux command to view the absolute path of the current directory is

[a.] cwd
[b.] del
[c.] pwd
[d.] cd

10. The coordination of a computer's activities is handled by the

[a.] the keyboard.


[b.] the operator.
[c.] the monitor.
[d.] the operating system.

11. A gigabyte is composed of

[a.] 1,024 megabytes.


[b.] 1,024 bytes.
[c.] 1,000 megabytes.
[d.] 1,000,000 bytes.

12. An IF statement is an example of a

[a.] repetition control structure meaning that the code is executed several times.
[b.] selection control structure meaning only one selection of the code is executed.
[c.] sequential control structure meaning each line of code is executed sequentially.
[d.] looping control structure meaning that the if statement causes the code to loop.

13. Which of the following is NOT a reserved word in Python?


[a.] then
[b.] if
[c.] for
[d.] in

Page 5 of 10 initials _____


CCOM 3030 Fall 2013
Exam 1

14. Which of the following is mostly likely a Python program?


[a.] myprogram.py
[b.] myprogram.pth
[c.] myprogram.c
[d.] myprogram.txt

15. What is the result of the following Linux command?

chmod 734 temp

[a.] Adds read, write, and execute permissions for a file named temp
[b.] Removes read, write, and execute permissions for a file named temp
[c.] Sets read, write, and execute permissions for a directory named temp
[d.] Adds read, write, and execute permissions for the owner a directory named
temp

16. What is the result of the following Linux command?

chmod o=rwx goodbye.java

[a.] Sets read, write, and execute permissions for the group of the file
goodbye.java
[b.] Sets read, write, and execute permissions for the others of file goodbye.java
[c.] Sets read, write, and execute permissions for a file named goodbye.java
[d.] Sets read, write, and execute permissions for the owner of the file
goodbye.java

17. What is the output of the following code in Python 3?

def greeting(hora):
if(hora <= 11):
print “Buen dia”
elif(hora <=18):
print “Buenas tardes”
else:
print “Buenas noches”
greeting(18);

[a.] gives an error [b.] “Buenas tardes” [c.] “Buenas noches” [d.] does nothing

18. What is the value of the Python expression 6 * 5 - (7 + 4) % 8?

[a.] 1 [b.] 27 [c.] 2 [d.] 2.375

Page 6 of 10 initials _____


CCOM 3030 Fall 2013
Exam 1

Short answer
Show all work to receive partial credit.

1. (2 pts. each) Convert the following number into decimal:

0243 _____________________________________

2. (2 pts.) Give the Linux command that creates a directory named CCOM3030 under
the current directory.
_____________________________________________

3. (2 pts.) Name two ways to get to your home directory no matter where you are in
Linux:

a. _________________________________________

b. _________________________________________

4. (2pts.) Give the Linux command that moves the file named first.pl into the
subdirectory proj1 where both the file and the subdirectory are in the current
working directory.
__________________________________________________

5. (2 pts. each) Convert the following numbers into binary:

0xf407 _____________________________________

0745 _____________________________________

2011 _____________________________________

Page 7 of 10 initials _____


CCOM 3030 Fall 2013
Exam 1

6. (2pts.) Give the UNIX command that lists all files in the current directory that
begin with the letters fun.
_____________________________________________

IV. Name the following components of a computer. (2 points each)

Page 8 of 10 initials _____


CCOM 3030 Fall 2013
Exam 1

Programming (10 points)

Write a program for the “Guess the Number” game. The player may guess a total of 6
times before they have lost. The program must prompt the user for their name
when they begin the game and prompt them for a number every time they are going
to try to guess the mystery number. The number to guess is between 1 and 20 and
you may use functions from Python’s library like random.randint(1,20) to generate
the mystery number. (Remember to use “import random” at top of program). Five
points extra credit for those who manage to incorporate functions into their
program and can keep track of the number of guesses of the player. You may use
the back of this page to write your program and take notes on this page. Partial
credit will be given for ideas of how the program should work.

Sample output:
Hello! What is your name?
Albert
Well, Albert, I am thinking of a number between 1
and 20.
Take a guess.
10
Your guess is too high.
Take a guess.
2
Your guess is too low.
Take a guess.
4
Good job, Albert!
You guessed my number in 3 guesses! Extra Credit

Page 9 of 10 initials _____


CCOM 3030 Fall 2013
Exam 1

Intentionally left blank for use as Scrap Paper by student.

Page 10 of 10 initials _____

You might also like