• No results found

1. Each of the four items below is an example of either a stack or a queue. Which one is different from the other three?

a. A street parade

b. A cafeteria tray dispenser c. Airplanes sitting on a runway d. Cars on an assembly line

2. A queue uses logic that comes from an acronym called: a. DITO

b. LIFO c. FIFO d. LILO

3. Each of the four items below is an example of either a tree or a graph. Which one is different from the other three?

a. A company organization chart b. People linked on LinkedIn

c. The floor plan of the Detroit Auto Show d. A map of the Wayne State University campus

4. You have an Excel spreadsheet named StudentClasses with 5 columns. The column headers are StudentName, Gender, ClassNumber, ClassSection and BuildingName. The spreadsheet is filled with data relative to those columns. You filter the data based on Gender and ClassSection selecting males in class section 10045 and then you sort the filtered data by StudentName. The equivalent SQL statement that will perform a similar filter and order command is:

a. Select all from StudentClasses where (Gender = “Male”) and (ClassSection = 10045) Order by Gender

b. Select all from StudentClasses where (Gender = “Male”) or (ClassSection = 10045) Order by StudentName

c. Select all from StudentClasses where (Gender = “Male”) and (ClassSection = 10045) Order by StudentName

d. Select all from StudentClasses where Gender = (“Male” and ClassSection) = 10045 Order by StudentName

5. This search algorithm named MaxItem contains an array called BigArray. The algorithm is supposed to return the largest item in an array. What is syntactically wrong with this

algorithm that will prevent it from working properly? MaxItem(bigArray [0…n – 1]) maxNum = bigArray [0] For j = 1 to n – 1 do If bigArray [j] < maxNum maxNum = bigArray [j] Loop Return maxNum

a. The For loop should loop from j = 1 to n + 1 instead of n – 1

b. The logic should read bigArray [j] > maxNum instead of bigArray[j] < maxNum c. The Return maxNum command should be before the Loop statement instead of

after the Loop statement

d. There is nothing wrong with this algorithm

6. In a bubble sort, the set of integers are sorted by comparing each number and the next number and swapping the two numbers into the correct order from the beginning of the array to the end. This process is repeated until the entire array has been sorted. After completing only one pass of a bubble sort using the numbers {52, 37, 4, 71, 24, 18}, what is the order of the numbers?

a. {37, 4, 52, 24, 18, 71} b. {4, 18, 24, 37, 52, 71} c. {37, 18, 24, 4, 52, 71} d. {24, 37, 4, 18, 71, 52}

7. Here is an array named SpringBreak[0…n] that contains the names of 10 popular spring break cities {Acapulco, Cancun, Miami, Nassau, New Orleans, New York, Palo Alto, Panama City, San Juan, Virginia Beach}. The term SpringBreak[5] returns which city?

a. New Orleans b. New York c. Palo Alto d. Virginia Beach

8. Which one of these four programming syntax items is an example of a Conditional Statement?

a. For… Loop b. Case Statement c. While… Do d. Repeat…Until

9. Given an array of numbers S={2, 3, 4, 5, 6, 8, 9}. You used a backtracking algorithm to find the combination of all numbers that sum to the amount of 12. Each number can only

be used one time. How many sets of numbers should the algorithm produce? a. 2

b. 3 c. 4 d. 5

10. A post office kiosk can complete a number of transactions without the need of visiting the service desk. Each option on the screen represents a separate object that can be executed without impact to or input from the other options on the screen. The practice of breaking down a system to independent objects so that the system is easier to manage and understand is known as:

a. Transformation b. Decomposition c. Randomization d. Aliasing

11. You are doing research on College Study Practices. You collected data in an Excel spreadsheet containing Student Names, Age and Daily Study Hours. The data is loaded into a scatterplot placing Age on the y-axis and Daily Study Hours on the x-axis. Each dot represents the name of each student. You removed the students’ names to include only the data that will help to show the trend in the graph. This process is known as:

a. Decomposition b. Abstraction c. Reduction d. Simulation

12. One technique used in object-oriented programming that prevents data from one object to be inadvertently updated by another object is called:

a. Polymorphism b. Encapsulation c. Inheritance d. Abstraction

13. You have two machines that are dependent on each other. The first machine produces output that is input for the second machine. The first machine will take two (2) hours to run and the second machine will take three (3) hours to run. Say that you had 5 sets of tasks to run through these machines. If you waited for each set to complete in its entirety, it will take you 25 hours to complete all 5 sets. If you were to start the next instance of task one as soon as the previous instance of task one completed instead of waiting for both task one and two to complete, how much time would it take to complete all 5 sets?

a. 10 hours b. 14 hours c. 17 hours d. 22 hours

14. Here is an object called SalesTaxes that keeps track of the amount you are spending on sales taxes:

Class SalesTaxes { Public:

decimal: totalTaxes;

void calcTaxes (decimal, decimal); void initTaxes();

}

void SalesTaxes: calcTaxes (decimal amount, decimal taxPercent){ totalTaxes = totalTaxes + taxPercent * amount;

}

void SalesTaxes: initTaxes (){ totalTaxes = 0;

}

What is the result of totalTaxes after the following functions are called in this order? initTaxes(); calcTaxes(4.00, 0.06) calcTaxes(5.00, 0.04) a. 0.25 b. 1.00 c. 0.37 d. 0.44

15. Error Handling is an important part of programming and life in general. This is the practice of preparing to handle situations in case something goes wrong. For example, having extra money in an overdraft account in case you overspend your checking account or an air force pilot having a parachute in case the plane malfunctions. Note the function for converting pounds to kilograms and kilograms to pounds. What is one error handling check that this function is missing?

Function WeightConversion(char weightType, decimal weightAmt):float If weightType = “Kilograms”

Return myWeight = weightAmt x 2.2 Else If weightType = “Pounds”

Return myWeight = weightAmt / 2.2 Else

Return -1 End If

a. The function should check that weightType is either Kilograms or Pounds b. The function should check that weightAmt is always greater than 0. c. The function should check that weightAmt is always a whole number d. The function should check that the denominator is always 2.2

16. Which of the examples below is not an example of prefetching and caching? a. Loading books into a book bag for class

b. Prepping a work station for an assembly line c. Dismantling a computer

d. Loading a video clip for it to play

17. The process of having a function call itself as part of the function to calculate the solution is called:

a. Recursion b. Iteration c. Polymorphism d. Decomposition

18. Note the nested programming example below that has a “For…Loop” inside of a “While…Loop”. How many times will the “While Loop” call the “For Loop”: N = 0; While N <= 20 do For J = 0 to 5 N = N + 1 Loop End While a. 4 b. 5 c. 6 d. 7

19. You have a list of groceries containing a capacity amount and a price. The goal is to purchase the items that will feed the most people for under $50.00. The options are showing in the following table:

Capacity 4 2 7 9

Price 16 9 30 24

What would be the maximum number of people that can be fed for $50.00? a. 14

b. 15 c. 16 d. 22

20. Each of the four items below is an example of either asynchronous or synchronous communication. Which one is different from the other three?

a. Cell phone call b. Skype

c. Twitter

Related documents