Programming Essentials

  1. 1.     The two major components of any computer system are its __________.   




    A. hardware and software
  2. The major computer operations include __________.   



    D. input, processing, and output
  3. Another term meaning “computer instructions” is __________.   



    A. software
  4. Visual Basic, C++, and Java are all examples of computer __________.   



    C. programming languages
  5. A programming language’s rules are its __________.   



    C. syntax
  6. The most important task of a compiler or interpreter is to __________.   



    C. translate programming language statements into machine language
  7. Which of the following terms is most closely related to machine language?   



    C. binary language
  8. Which of the following is true about newer programming languages as opposed to older ones?   



    B. They allow you to use reasonable names for memory locations. 
  9. Object-oriented programming focuses most on __________.   



    C. objects
  10. The attributes of an object are the things that it __________.   



    D. has
  11. In object-oriented programming, each object __________.   



    B. both of these
  12. Originally, object-oriented programming was used most frequently for two major types of applications. These were __________.    a.     payroll and inventory
    b.     input and storage
    c.     computer simulations and graphical user interfaces
    d.     public and private applications
    c. computer simulations and graphical user interfaces
  13. Identifying all the objects you want to manipulate and how they relate to each other is known as __________.   



    D. data modeling
  14. Writing a program in a language such as C++ or Java is known as __________ the program.   



    A. coding
  15. A compiler would find all of the following programming errors except __________.    a.     the misspelled word “prrint” in a language that includes the word “print”
    b.     the use of an “X” for multiplication in a language that instead requires an asterisk
    c.     a newBalanceDue calculated by adding a customerPayment to an oldBalanceDue instead of subtracting it
    d.     an arithmetic statement written as regularSales + discountedSales = totalSales
    c. a newBalanceDue calculated by adding a customerPayment to an oldBalanceDue instead of subtracting it
  16. The two most commonly used tools for planning a program’s logic are __________.   



    A. flowcharts and pseudocode
  17. In a flowchart, input is represented by a(n) _____.   



    D. parallelogram
  18. In a flowchart, processing is represented by a(n) _____.   



    A. rectangle
  19. When you use an IDE instead of a simple text editor to develop a program, _____.   



    D. some help is provided
  20. When you write a program that will run in a GUI environment as opposed to a command-line environment, _____.   



    A. some syntax is different
  21. The selection statement if quantity > 100 then discountRate = RATE is an example of a __________.   



    D. single-alternative selection
  22. The selection statement if dayOfWeek = “Sunday” then price = LOWER_PRICE else price = HIGHER_PRICE is an example of a __________.   



    C. dual-alternative  selection
  23. All selection statements must have __________.   



    D. an if clause
  24. An expression like amount < 10 is a(n) __________ expression.   



    B. Boolean
  25. Usually, you compare only variables that have the same __________.   



    C. type
  26. Symbols like > and < are known as __________ operators.   



    A. relational comparison
  27. If you could use only three relational comparison operators, you could get by with __________.   



    A. equal to, less than, and greater than
  28. If a > b is false, then which of the following is always true?   



    A. a <= b
  29. Usually, the most difficult comparison operator to work with is __________.   



    C. not equal to
  30. Which of the lettered choices is equivalent to the following decision?   

    if x > 10 then       
       if y > 10 then          
          output "X"       
       endif    
    endif




    B. if x > 10 AND y > 10 then output "X"
  31. The Acme Computer Company operates in all 50 of the United States. The Midwest Sales region consists of five states—Illinois, Indiana, Iowa, Missouri, and Wisconsin. Suppose you have input records containing Acme customer data, including state of residence. To most efficiently select and display all customers who live in the Midwest Sales region, you would use __________.    a.     five completely separate unnested if statements
    b.     nested if statements using AND logic
    c.     nested if statements using OR logic
    d.     Not enough information is given
    c. nested if statements using AND logic
  32. The Midwest Sales region of Acme Computer Company consists of five states—Illinois, Indiana, Iowa, Missouri, and Wisconsin. About 50 percent of the regional customers reside in Illinois, 20 percent in Indiana, and 10 percent in each of the other three states. Suppose you have input records containing Acme customer data, including state of residence. To most efficiently select and display all customers who live in the Midwest Sales region, you would ask first about residency in __________.   



    A. Illinois
  33. The Boffo Balloon Company makes helium balloons. Large balloons cost $13.00 a dozen, medium-sized balloons cost $11.00 a dozen, and small balloons cost $8.60 a dozen. About 60 percent of the company’s sales are the smallest balloons, 30 percent are the medium, and large balloons constitute only 10 percent of sales. Customer order records include customer information, quantity ordered, and size. For the most efficient decision when you write a program to determine price based on size, you should ask first whether the size is __________.   



    A. small
  34. The Boffo Balloon Company makes helium balloons in three sizes, 12 colors, and with a choice of 40 imprinted sayings. As a promotion, the company is offering a 25-percent discount on orders of large, red “Happy Valentine’s Day” balloons. To most efficiently select the orders to which a discount applies, you would use __________.   



    D. nested if statements using AND logic
  35. Radio station FM 99 keeps a record of every song played on the air in a week. Each record contains the day, hour, and minute the song started, and the title and artist of the song. The station manager wants a list of every title played during the important 8 a.m. commute hour on the two busiest traffic days, Monday and Friday. Which logic would select the correct titles?   



    D. if hour = 8 then if day = "Monday" OR day = "Friday" then               output title            endif endif
  36. In the following pseudocode, what percentage raise will an employee in Department 5 receive?

    if department < 3 then raise = SMALL_RAISE else if department < 5 then raise = MEDIUM_RAISE else raise = BIG_RAISE endif endif



    A. BIG_RAISE
  37. In the following pseudocode, what percentage raise will an employee in Department 8 receive?

    if department < 5 then raise = SMALL_RAISE else if department < 14 then  raise = MEDIUM_RAISE else if department < 9 raise = BIG_RAISE endif endif endif




    C. MEDIUM_RAISE
  38. In the following pseudocode, what percentage raise will an employee in Department 10 receive?

    if department < 2 then raise = SMALL_RAISE else if department < 6 then raise = MEDIUM_RAISE else if department < 10 raise = BIG_RAISE endif endif endif




    B. Impossible to tell
  39. In the following pseudocode, what percentage raise will an employee in Department 3 receive?

    if department < 2 then raise = SMALL_RAISE endif = BIG_RAISE if department < 6 then raise = MEDIUM_RAISE endif if department < 10 raise endif




    D. BIG_RAISE
  40. Which of the following is true?   



    B. The AND operator has higher precedence than the OR operator.
Author
Anonymous
ID
209427
Card Set
Programming Essentials
Description
Test Study Questions
Updated