Your downloadable files for Chapter 7 include a file named DEBUG07-04.jpg that contains a flowchart with syntax and/or logical errors. Examine the flowchart, and then find and correct all the bugs.
Which of the following code segments correctly swaps the values of variables named x and y? a. x = y y = temp x = temp b. temp = x x = y y = temp c. x = y temp = x y = temp d. temp = x y = x x = temp
When a record in an indexed file is not needed for further processing, _____. a. Its first character must be replaced with a special character, indicating it is a deleted record b. Its position must...
Design an application that accepts 15 words and displays them in alphabetical order.
Your downloadable files for Chapter 8 include DEBUG08-01.txt, DEBUG08-02.txt, and DEBUG08-03.txt. Each file starts with some comments that describe the problem. Comments are lines that begin with two...
Which of the following is true? a. A program can call one method at most. b. A method can contain one or more other methods. c. A program can contain a method that calls another method. d. All of the...
Which of the following must every method have? a. A parameter list b. A header c. A return value d. All of the above
Which of the following is most closely related to the concept of local? a. In scope b. Object-oriented c. Program level d. Abstract
A methods interface is its _____. a. Parameter list b. Return type c. Identifier d. All of the above
When you write the declaration for a method that can receive a parameter, which of the following must be included in the method declaration? a. The name of the argument that will be used to call the...
When you use a variable name in a method call, it _____ as the variable in the method header. a. Can have the same name b. Cannot have the same name c. Must have the same name d. Cannot have the same...
The value used in a methods return statement must _____. a. Be numeric b. Be a variable c. Match the data type used before the method name in the header d. Two of the above
When a method receives a copy of the value stored in an argument used in the method call, it means the variable was _____. a. Unnamed b. Passed by value c. Passed by reference d. Assigned its...
A void method _____. a. Contains no statements b. Requires no parameters c. Returns nothing d. Has no name
When an array is passed to a method, it is _____. a. Passed by reference b. Passed by value c. Unnamed in the method d. Unalterable in the method
When you overload a method, you write multiple methods with the same_____. a. Name b. Parameter list c. Number of parameters d. Return type
A program contains a method with the header num calculateTaxes(num amount, string name). Which of the following methods can coexist in the same program with no possible ambiguity? a. Num...
Methods in the same program with identical names and identical parameter lists are _____. a. Overloaded b. Overworked c. Overwhelmed d. Ambiguous
Methods in different programs with identical names and identical parameter lists are _____. a. Overloaded b. Illegal c. Both of the above d. None of the above
The notion of _____ most closely describes the way a calling method is not aware of the statements within a called method. a. Abstraction b. Object-oriented c. Implementation hiding d. Encapsulation
Which of the following means the same as object? a. Instance b. Class c. Field d. Category
A program that instantiates objects of another prewritten class is a(n) ________. a. Instance b. Object c. Client d. GUI
The relationship between an instance and a class is a(n) ________ relationship. a. Has-a b. Hostile c. Polymorphic d. Is-a
Which of these does not belong with the others? a. Instance variable b. Attribute c. Object d. Field
When discussing classes and objects, encapsulation means that ________. a. All the fields belong to the same object b. All the fields are private c. All the fields and methods are grouped together d....
Every class definition must contain ________. a. A name b. Data c. Methods d. All of the above
Assume that a working program contains the following statement: name = myDog.getName() Which of the following do you know? a. getName() returns a string. b. getName() returns a value that is the same...
A class diagram ________. a. Provides an overview of a classs data and methods b. Provides method implementation details c. Is never used by nonprogrammers because it is too technical d. All of the...
Which of the following is the most likely scenario for a specific class? a. Its data is private and its methods are public. b. Its data is public and its methods are private. c. Its data and methods...
Complete the following tasks: a. Design a class named StockTransaction that holds a stock symbol (typically one to four characters), stock name, and price per share. Include methods to set and get...
Use the procedure described in Lemma 1.60 to convert the following finite automata to regular expressions. a a 1 ,b 1 b a b a 3 () (b)
Complete the following tasks: a. Design a class named Book that holds a stock number, author, title, price, and number of pages. Include methods to set and get the values for each data field. Also...
Complete the following tasks: a. Design a class named Player that holds a player number and name for a sports team participant. Include methods to set the values for each data field and output the...
Give the formal description of the machines M 1 and M 2 pictured in Exercise 1.1. Exercise 1.1 The following are the state diagrams of two DFAs,M 1 andM 2 . Answer the following questions about each...
Each of the following languages is the intersection of two simpler languages. In each part, construct DFAs for the simpler languages, then combine them using the construction discussed in footnote 3...
The manager of Keystone Tile wants an application that displays the area of a rectangular floor, given its measurements in feet. It should also display the total cost of tiling the floor, given the...
a. Write an application containing an array of 20 String values, and display them in ascending order. Save the file as StringSort.java. b. Write an application that accepts any number of String...
a. In Chapter 9, you created a Tic Tac Toe game in which you used a 2D array of characters to hold Xs and Os for a player and the computer. Now create a JPanel that uses an array of nine JButtons to...
a. In Chapters 7 and 8, you created a game named Secret Phrase in which the user guesses a randomly selected secret phrase by entering one letter at a time. Now create a GUI application that plays...
If you want the user to input an integer value into your program for a variable named number, what are two lines of code you could write to ask the user to do it and to input the value into your...
Show (as circles-and-arrows diagrams) the finite automata for Exercise 2.1. Data from Exercise 2.1: Write regular expressions to capture the following. (a) Strings in C. These are delimited by double...
Consider the following pseudocode: x : integer := 1 y : integer := 2 procedure add() x := x + y procedure second(P : procedure) x : integer := 2 P() procedure first y : integer := 3 second(add)...
Consider the following code skeleton in C++: Explain why the compiler wont allow the second call. Give an example of bad things that could happen if it did. #include using std::1ist; class foo {......
Modify the Maze class so that it prints out the path of the final solution as it is discovered, without storing it.
Write a function to put 10 pixel wide prison cell bars on the left border, center, and right border of an input picture.
Mathematicians talk about the Fibonacci Sequence, which is a series of numbers defined recursively. The first Fibonacci number is 0, and the second is 1. From there on out, the nth Fibonacci number...
Define a class called TicTacToe. An object of type TicTacToe is a single game of tic-tactoe. Store the game board as a single two-dimensional array of base type char that has three rows and three...
Write a program that will read a line of text that ends with a period, which serves as a sentinel value. Display all the letters that occur in the text, one per line and in alphabetical order, along...
Programming Project 2 asks you, among other things, to write a program that creates a binary file of objects of the class Species. Write a program that reads from a file created by that program and...
Write an inheritance hierarchy to model items at a library. Include books, magazines, journal articles, videos, and electronic media such as CDs. Include in a superclass and/or interface common...
What is the disadvantage of having too many features in a language?
Write a method called maxToTop that takes a stack of integers as a parameter and moves the largest value in the stack to the top of the stack, leaving all other values in their original order. You...
If Name1 = "John" and Name2 = "Smith", what string results from each of the following operations? a. Name1 + Name2 b. Name2 + ", " + Name1
What is the output of this program if K = 3? Main Declare K As Integer Input K Set Result = F(K) Write Result End Program Function F(N) As Integer If N == 1 Then Set F = 1 Else Set F = N * F(N-1) Set...
Write a program that inputs (from the user) the number of hours worked and hourly pay rate for employees and outputs their total pay. The program should process an arbitrary number of employees; the...
Write a method called surroundWith that takes an integer x and an integer y as parameters and surrounds all nodes in the list containing the value x with new nodes containing the value y. In...
A buffer is 2 MiB in size. The lower limit of the buffer is set at 200 KiB and the higher limit is set at 1.8 MiB. Data is being streamed at 1.5 Mbps and the media player is taking data at the rate...
When a DMA module takes control of a bus, and while it retains control of the bus, what does the processor do?
How many check bits are needed if the Hamming error correction code is used to detect single bit errors in a 1024-bit data word?
Draw an E-R diagram to represent the sample customer order in Figure 8-4. Figure 8-4. PVF CUSTOMER ORDER ORDER NO: 61384 CUSTOMER NO: 1273 NAME: Contemporary Designs 123 Oak St. Austin, TX 28384...
Map the BANK ER schema of Exercise 3.23 (shown in Figure 3.21) into a relational schema. Specify all primary keys and foreign keys. Repeat for the AIRLINE schema (Figure 3.20) of Exercise 3.19 and...
What undesirable dependencies are avoided when a relation is in 2NF?
Repeat Exercise 14.24 for the following different set of functional dependencies G = {{A, B}{C}, {B, D}{E, F}, {A, D}{G, H}, {A}{I}, {H}{J}}. Exercise 14.24 Consider the universal relation R = {A, B,...
Discuss the different measures of transaction equivalence. What is the difference between conflict equivalence and view equivalence?
Consider the two tables T1 and T2 shown in Figure 8.15. Show the results of the following operations: a. T1 T1.P = T2.A T2 b. T1 T1.Q = T2.B T2 c. T1 T1.P = T2.A T2 d. T1 T1.Q = T2.B T2 e. T1 T2 f....
Design a database to keep track of information for an art museum. Assume that the following requirements were collected: The museum has a collection of ART_OBJECTS. Each ART_OBJECT has a unique...
Explain the role of middleware in client/server computing.
Imagine that you are to design a budget report for a colleague at work using a spreadsheet package. Following the prototyping discussed in the chapter (see also Figure 6-7), describe the steps you...
Examine the help systems for some software applications that you use. Evaluate each using the general guidelines provided in Table 11-11. Table 11-11. Guideline Explanation Simplicity Use short,...
The final task in the preliminary investigation is to summarize the results and recommendations in a report and/or in a presentation. Which form of communication, written or oral, do you think is the...
What are the five steps in the software acquisition process?
Suppose your university is offering some courses in business analytics: a six-month certificate course, a two-year regular program, and a three-year part-time program. You are required to design a...
Design the wireframes and storyboard, interactivity diagram, object dictionary, and any necessary scripts for an interactive program for customers of the Dharma Day Spa. Allow customers the option of...
Design a program for the Caf Noir Coffee Shop to provide some customer market research data. When a customer places an order, a clerk asks for the customers zip code and age. The clerk enters that...
Suppose we have an nn two-dimensional array A that we want to use to store integers, but we dont want to spend the O(n 2 ) work to initialize it to all 0s, because we already know that we are only...
Write, compile, and test a class that displays the following statement about comments on two lines: Program comments are nonexecuting statements you add to a file for documentation. Also include the...
a. Yummy Catering provides meals for parties and special events. Write a program that displays Yummy Caterings motto, which is Yummy makes the food that makes it a party. Save the file as...
What is the relationship between a table of Movies and a table of ActorsActresses and how might it be implemented in a relational database?
Discuss how the IT auditor can benefit an organizations system development and implementation process.
You are asked by your IT audit manager to: Prepare a list of at least five professional certifications/designations that would be helpful for the IT audit staff to have. In a three-column table...
Write the state equations for the observer canonical form of a system, shown in Fig. 2-10, which has the transfer function given in (2-51) and (2-61) Figure 2-10 G(z) = + 2"+an-12"-1 +byz + bo *** +...
(a) Show that a pole of E(s) in the left half-plane transforms into a pole of E(z) inside the unit circle. (b) Show that a pole of E(s) on the imaginary axis transforms into a pole of E(z) on the...
A double pipe heat exchanger is made of a 6-nom sch 40 commercial steel outer pipe and a 5-nom sch 40S stainless steel inner pipe. The fluid in the annular space is cyclohexane that has a volumetric...
Hosts A and B are each connected to a switch S via 10-Mbps links as in Figure 1.21. The propagation delay on each link is 20 s. S is a store-and-forward device; it begins retransmitting a received...
Calculate the total time required to transfer a 1000-kB file in the following cases, assuming an RTT of 100 ms, a packet size of 1 kB data, and an initial 2 RTT of handshaking before data are sent....
For the following C statement, what is the corresponding MIPS assembly code? Assume that the variables f, g, h, i, and j are assigned to registers $s0, $s1, $s2, $s3, and $s4, respectively. Assume...
Consider two different implementations of the same instruction set architecture. Th e instructions can be divided into four classes according to their CPI (class A, B, C, and D). P1 with a clock rate...
For the MIPS assembly instructions in Exercise 2.4, rewrite the assembly code to minimize the number if MIPS instructions (if possible) needed to carry out the same function. Exercise 2.4 For the...
Translate the following MIPS code to C. Assume that the variables f, g, h, i, and j are assigned to registers $s0, $s1, $s2, $s3, and $s4, respectively. Assume that the base address of the arrays A...
Assume 185 and 122 are unsigned 8-bit decimal integers. Calculate 185 122. Is there overflow, underflow, or neither?
What decimal number does the bit pattern 00C000000 represent if it is a floating point number? Use the IEEE 754 standard.
Using the IEEE 754 floating point format, write down the bit pattern that would represent -1/4. Can you represent -1/4 exactly?
Calculate the sum of 2.6125 10 1 and 4.150390625 10 -1 by hand, assuming A and B are stored in the 16-bit half precision described in Exercise 3.27. Assume 1 guard, 1 round bit, and 1 sticky bit,...
Describe an algorithm for concatenating two singly linked lists L and M, into a single list L that contains all the nodes of L followed by all the nodes of M.
Give a recursive algorithmto compute the product of two positive integers, m and n, using only addition and subtraction.
Explain how to modify the recursive binary search algorithm so that it returns the index of the target in the sequence or 1 (if the target is not found).
Given an unsorted array, A, of integers and an integer k, describe a recursive algorithm for rearranging the elements in A so that all elements less than or equal to k come before any elements larger...
Al says he can prove that all sheep in a flock are the same color: Base case: One sheep. It is clearly the same color as itself. Induction step: A flock of n sheep. Take a sheep, a, out. The...
Chip multiprocessors (CMPs) have multiple cores and their caches on a single chip. CMP on-chip L2 cache design has interesting trade-off s. Th e following table shows the miss rates and hit latencies...
Describe how to perform a removal from a hash table that uses linear probing to resolve collisions where we do not use a special marker to represent deleted elements. That is, we must rearrange the...