CSC001- Midterm Spring 98

ublkline620.GIF (83 bytes)

D. Joseph

Answer questions 1 through 30 on your Scantron form.
Questions 1 - 15 are are T/F (2 points each).
Questions 16 - 30 are Multiple Choice (3 pts each).
Questions 31 - 46 are a mixture of short answer, T/F, MC, programming, etc. Answer these questions in the test booklet. (Show all work and remember to write legibly!)


True/False and Multiple Choice

    1. The filename "Physics report.doc" is a valid DOS filename.
      1. true
      2. false

    2. Control structures are instructions that specify the sequence in which program instructions are executed.
      1. true
      2. false

    3. An operating system file that is used to keep track of the physical location of files is the FAT.
      1. true
      2. false

    4. The data bus transports data to peripheral devices along the peripheral highway.
      1. true
      2. false

    5. The maximum number of different units of information you can convey with n bits is 2 to the nth power.
      1. true
      2. false

    6. A high-level language allows a programmer to use instructions that are more like a human language.
      1. true
      2. false

    7. CMOS memory is able to hold its contents when the computer is powered off.
      1. true
      2. false

    8. A software copyright gives the purchaser of the software the right to make copies of it for any desired purpose.
      1. true
      2. false

    9. The four primary functions of a computer are to accept input, process data, store data, and produce output.
      1. true
      2. false

    10. A byte is the smallest unit of information a computer can process.
      1. true
      2. false

    11. LAN is an acronym for local asynchronous network.
      1. true
      2. false

    12. A megabyte is approximately one billion bytes of storage.
      1. true
      2. false

    13. The recipient of an e-mail message will never receive the message if he or she is not logged on when the message is sent.
      1. true
      2. false

    14. System software helps the computer perform its basic operating tasks.
      1. true
      2. false

    15. Floppy disks, hard disks, and CD-ROM disks are all examples of storage media.
      1. true
      2. false

    16. A CPU has two primary parts, the
      1. arithmetic and logical units.
      2. arithmetic and control units.
      3. accumulator and calculator units.
      4. accumulator and control units.

    17. Legal protection granting certain rights to the author of a computer program is a
      1. copyright.
      2. patent.
      3. hallmark.
      4. license.

    18. One purpose of an operating system is to test system components and detect
      1. device or system failures.
      2. errors in data files.
      3. how many users are logged on.
      4. none of the above.

    19. The process of using a computer language to express an algorithm is known as:
      1. programming.
      2. coding.
      3. writing a program.
      4. all of the above

    20. When typing text into a new word-processing document, the document’s data is stored
      1. on disk as a temporary file.
      2. on disk as a permanent file.
      3. in the disk cache.
      4. in memory.

    21. Tape storage is much slower than disk storage because tape drives use __________ access.
      1. sequential
      2. random
      3. direct
      4. in-line

    22. The IF...THEN command is an example of a:
      1. sequence control.
      2. selection control.
      3. repetition control.
      4. none of the above

    23. Margaret’s computer at work is not connected to the company network, or to any other computer. This computer is referred to as a(n)
      1. unit resource.
      2. external unit.
      3. standalone computer.
      4. isolated computer.

    24. An asterisk used to represent a group of characters in a filename is a(n)
      1. wildcard character.
      2. generic replacement character.
      3. aliased character.
      4. mass-substitute character.

    25. Data that is fed into a computer is called
      1. output.
      2. storage.
      3. information.
      4. input.

    26. Mary needs to add an internal modem to her computer. To do so, the computer must have an empty
      1. device driver.
      2. port.
      3. device depot.
      4. expansion slot.

    27. One of the main objectives of a computer’s boot process is to
      1. load the operating system files into ROM.
      2. see if new devices have been added.
      3. load the operating system files into RAM.
      4. launch the anti-virus software.

    28. A computer processes data in pulses, which are determined by the
      1. system clock.
      2. ROM.
      3. BIOS.
      4. ALU.

    29. A user interface is a(n)
      1. object oriented program.
      2. peripheral device.
      3. software program.
      4. combination of hardware and software.

    30. File compression:
      1. should not be used for important files because some data is lost during the compression process.
      2. is irreversible.
      3. can reduce the space required to store a file.
      4. cannot be used with word processing documents.

 

 

Short Answer, Programming, etc.

 

    1. (4 pts) What is the output?
    2. CLS
      A = 5
      B = 4
      C = 10
      D = 8
      PRINT (C + D) / (A + B)
      PRINT A * C + D / B

       

    3. (4 pts) What is a computer's data bus?
    4.  

       

    5. (4 pts) What is pseudocode?
    6.  

       

    7. (4 pts) What is wrong with the following program?
    8. CLS
      LET C = 4
      LET B$ = "5"
      LET AVG = C + B / 2
      PRINT AVG

       

    9. (4 pts) Write a program that asks the user to input 2 numbers and then calculates and prints the average of the two numbers.
    10.  

       

    11. (6 pts)
    12. INPUT "Please enter a number", Num

      IF Num > 0 AND Num > 2 THEN

      PRINT "Yee Ha"

      ELSE

      PRINT "Oh"

      END IF

      IF Num = 0 OR Num < 0 THEN

      PRINT "Good"

      ELSE

      PRINT "Bad"

      END IF

      What is the output for these values of Num?

      1. 1
      2.  

      3. 0

       

    13. (5 pts)
    14. IF Num > 0 THEN

      IF Num < 5 THEN

      PRINT "Hello"

      ELSE

      PRINT "Hi"

      END IF

      ELSE

      PRINT "Hey"

      END IF

      What is the output if Num is equal to 4?

       

       

    15. (6 pts) Convert the following binary (base 2) number to a decimal (base 10) number:
    16. 110010.11011 = __________________

       

    17. (6 pts) Convert the following decimal (base 10) number to a binary (base 2) number:
    18. 27.2 = _____________________________________

       

    19. (4 pts) How many bytes of memory are needed to store 'Spring Break is coming soon!' ( not including the ' ' marks)?
    20. ____________________ byte(s)

       

    21. (4 pts) What type of device would you connect to a serial port? What type of device would you connect to a parallel port?
    22.  

    23. (5 pts) Show what will be displayed on the output screen after the following program executes.
    24. CLS

      Alpha = 4

      Beta = 6

      Delta = 7

      IF Alpha ^ 2 >= Delta AND (Alpha = Delta OR Delta >= Beta) THEN

      Delta = 2 * Alpha ^ 2

      Beta = 2 * Delta

      ENDIF

      PRINT "Delta is "; Delta

      PRINT "Beta is "; Beta

       

    25. (4 pts) Write a QBASIC IF statement to print "Valid score!" if the user entered a score, MyScore, in the range of 0 to 100.
    26.  

    27. (3 pts) The operators, AND and OR, are called
      1. Relational operators.
      2. Logical operators.
      3. Smooth operators.
      4. None of the above.
    28. (4 pts) When you login to Eureka, you login with ____________________ as the user id.
    29.  

    30. (8 pts) Using the method from chapter 7 to develop a program:

 

Step 1: Identify the problem.

The problem is a professor wants to tally each student's total points earned thus far. Rather than doing this by hand he asked you for a simply program that would do the adding for him. He also wants the average of the four homework assignments.

  1. Input

The code will need the following information from the professor:

  • Student's name
  • the four homework scores
  1. Output

Ought to look like this:

(student name) has earned ### points in the class and has an average of ### for the homework score.

Step 2: Design an algorithm.

You design the flow chart for Step 1 here:

 


 

ublkline620.GIF (83 bytes)

Return to:  CSUS | Computer Science

October 9, 1998
Comments to:  josephd@csus.edu