Create a Web page for Heather Sweeney Designs to display data in the SEMINAR,SEMINAR_CUSTOMER, and CUSTOMER tables to list the SEMINARdata and the EmailAddress, LastName, FirstName, and Phone of any...
A three-input AND-OR (AO) gate shown in Figure 1.42 produces a TRUE output if both A and B are TRUE, or if C is TRUE. Complete a truth table for the gate. A- - C- -Y Figure 1.42 Three-input AND-OR...
Rewrite the syncbad module from HDL Example 4.29. Use nonblocking assignments, but change the code to produce a correct synchronizer with two flip-flops.
Repeat Exercise 2.7 using only NOT gates and NAND and NOR gates.
Write Boolean equations for the circuit in Figure 2.82. You need not minimize the equations. D Figure 2.82 Circuit schematic
A circuit has four inputs and two outputs. The inputs 3:0 represent a number from 0 to 15. Output P should be TRUE if the number is prime (0 and 1 are not prime, but 2, 3, 5, and so on, are prime)....
Design a modified priority encoder that receives an 8-bit input, A 7:0 , and produces two 3-bit outputs, Y 2:0 and Z 2:0 Y indicates the most significant bit of the input that is TRUE. Z indicates...
A JK flip-flop receives a clock and two inputs, J and K. On the rising edge of the clock, it updates the output, Q. If J and K are both 0, Q retains its old value. If only J is 1, Q becomes 1. If...
Repeat Exercise 2.26 for the circuit in Figure 2.84. Data From Problem 26. Using De Morgan equivalent gates and bubble pushing methods, redraw the circuit in Figure 2.83 so that you can find the...
A priority encoder has 2 N inputs. It produces an N-bit binary output indicating the most significant bit of the input that is TRUE, or 0 if none of the inputs are TRUE. It also produces an output...
Given the input wave forms shown in Figure 3.63, sketch the output, Q, of a D flip-flop. CLK D
Draw a state machine that can detect when it has received the serial input sequence 01010.
Redesign the priority encoder from Exercise 2.36 to be as fast as possible. You may use any of the gates from Table 2.8. Sketch the new circuit and indicate the critical path. What are its...
Determine the propagation delay and contamination delay of the circuit in Figure 2.84. Use the gate delays given in Table 2.8. Table 2.8 Gate delays for Exercises 2.432.47 (sd) Pdq 15 Gate ted (ps)...
Write a line of HDL code that gates a 32-bit bus called data with another signal called sel to produce a 32-bit result. If sel is TRUE, result = data. Otherwise, result should be all 0s.
Gray codes have a useful property in that consecutive numbers differ in only a single bit position. Table 3.23 lists a 3-bit Gray code representing the numbers 0 to 7. Design a 3-bit modulo 8 Gray...
Write an HDL module called minority. It receives three inputs, a, b, and c. It produces one output, y, that is TRUE if at least two of the inputs are FALSE.
Write an 8:1 multiplexer module called mux8 with inputs s 2:0 , d0, d1, d2, d3, d4, d5, d6, d7, and output y.
Logic errors are listed in the Error List window. a. True b. False
A computer that requests an asp page from a web server is called a _____________________ computer. A. Browser B. Client C. Requesting D. Server
The BYOD movement has serious implications for IT professionals, such as managing applications on user devices and security implications. Do you think BYOD is a net positive or a net negative for the...
Jesse wants a recommendation about creating an SCR help desk. She said that I can find lots of information about help desks on the Internet. At our meeting, Jesse asked me how SCR should manage the...
Go to the SEIs website on System of Systems at http://www.sei.cmu.edu/sos/. Document the main differences for a system analyst working at this scale, and describe the role CASE tools could play...
Search the Internet for a simple, user-friendly CASE tool that you would recommend for your schools computer lab. Visit the vendors site and learn all you can about the product. Write a brief report...
1. Review the organization chart you prepared in Chapter 1 and determine who should be on the JAD team, and why. Also, how will you create a sense of team ownership from the start? 2. You may be...
1. Based on the fact statements provided, summarize the maintenance departments most important strengths, weaknesses, opportunities, and threats. 2. Compared to a profit-making company, is it more...
In our implementation of the scale function (page 25), the body of the loop executes the command data[j] *= factor. We have discussed that numeric types are immutable, and that use of the *= operator...
An inverted sawtooth signal is given by the reflection x(-t), where x(t) is the sawtooth signal. Use the entry for the sawtooth signal in Table 4.2 to obtain a zeromean inverted sawtooth signal y(t)...
Show that 2 n+1 is O(2 n ).
Show that n log n is (n).
Show that n i=1 i 2 is O(n 3 ).
Describe an implementation of the PositionalList methods add last and add before realized by using only methods in the set {is empty, first, last, prev, next, add after, and add first}.
Implement a function that counts the number of nodes in a circularly linked list.
Alice has two queues, Q and R, which can store integers. Bob gives Alice 50 odd integers and 50 even integers and insists that she store all 100 integers in Q and R. They then play a game where Bob...
Consider the transmission of a sinusoid x(t) = cos(2f0t) through a channel affected by multi-path and Doppler. Let there be two paths, and assume the sinusoid is being sent from a moving object so...
The input of an LTI continuous-time system is x(t) = u(t) - u(t 3.5). The systems impulse response is h(t) = u(t) - u(t 2.5). (a) Find the systems output y(t) by graphically computing the...
Describe a recursive function for converting a string of digits into the integer it represents. For example, '13531' represents the integer 13,531.
Consider a situation in which a user has numeric keys and wishes to have a priority queue that is maximum-oriented. How could a standard (minoriented) priority queue be used for such a purpose?
On page 406 of Section 10.1.3, we give an implementation of the method setdefault as it might appear in the MutableMapping abstract base class. While that method accomplishes the goal in a general...
Average acceleration is defined as the change of velocity divided by the time taken to make the change, as shown in the following formula: Write a program that prompts the user to enter the starting...
Suppose you save $100 each month into a savings account with the annual interest rate 5%. Thus, the monthly interest rate is 0.05/12 = 0.00417. After the first month, the value in the account becomes...
Listing 3.3, SubtractionQuiz.java, randomly generates a subtraction question. Revise the program to randomly generate an addition question with two integers less than 100. Listing 3.3 1 import...
Listing 3.5, ComputeTax.java, gives the source code to compute taxes for single filers. Complete Listing 3.5 to compute the taxes for all filing statuses. Listing 3.5 1 import java.util.Scanner; 3...
Revise Listing 3.8, Lottery.java, to generate a lottery of a threedigit number. The program prompts the user to enter a three-digit number and determines whether the user wins according to the...
Zeller?s congruence is an algorithm developed by Christian Zeller to calculate the day of the week. The formula is where ? h is the day of the week (0: Saturday, 1: Sunday, 2: Monday, 3: Tuesday, 4:...
Suppose you shop for rice in two different packages. You would like to write a program to compare the cost. The program prompts the user to enter the weight and price of the each package and displays...
The classic Eight Queens puzzle is to place eight queens on a chessboard such that no two queens can attack each other (i.e., no two queens are on the same row, same column, or same diagonal). There...
Rewrite Listing 2.10, ComputeChange. java, to fix the possible loss of accuracy when converting a float value to an int value. Read the input as a string such as "11.56". Your program should extract...
The area of a hexagon can be computed using the following formula (s is the length of a side): Write a program that prompts the user to enter the side of a hexagon and displays its area. Here is a...
Listing 5.4, SubtractionQuizLoop.java, generates five random subtraction questions. Revise the program to generate ten random addition questions for two integers between 1 and 15. Display the correct...
Another solution for Listing 5.9 to find the greatest common divisor of two integers n1 and n2 is as follows: First find d to be the minimum of n1 and n2, then check whether d, d-1, d-2, . . . , 2,...
The String class is provided in the Java library. Provide your own implementation for the following methods (name the new class MyString2): public MyString2(String s); public int compare(String s);...
Suppose you have a lot of files in a directory named Exercisei_j, where i and j are digits. Write a program that pads a 0 before j if j is a single digit. For example, a file named Exercise2_1 in a...
A school has 100 lockers and 100 students. All lockers are closed on the first day of school. As the students enter, the first student, denoted S1, opens every locker. Then the second student, S2,...
Implement the following method to sort the columns in a twodimensional array. A new array is returned and the original array is intact.public static double[][] sortColumns(double[][] m)Write a test...
Suppose the weekly hours for all employees are stored in a two-dimensional array. Each row records an employee?s seven-day work hours with seven columns. For example, the following array stores the...
Write a program that repeatedly prompts the user to enter a capital for a state. Upon receiving the user input, the program reports whether the answer is correct. Assume that 50 states and their...
Write a program to display a recursive tree as shown in Figure 18.20. 1 Enter an order: Enter an order: Enter an order: Enter an order: 5 (b) (a)
Write a program that replaces all occurrences of a word with a new word in all the files under a directory, recursively. Pass the parameters from the command line as follows: java Exercise18_31...
Write a program that stores an array of the five int values 1, 2, 3, 4, and 5, a Date object for the current time, and the double value 5.5 into the file named Exercise17_05.dat.
Write a program that reads lines of characters from a text file and writes each line as a UTF-8 string into a binary file. Display the sizes of the text file and the binary file. Use the following...
Write a test program that randomly generates 500,000 numbers and inserts them into a BST, reshuffles the 500,000 numbers and performs a search, and reshuffles the numbers again before deleting them...
The two-dimensional arrays m1 and m2 are strictly identical if their corresponding elements are equal. Write a method that returns true if m1 and m2 are strictly identical, using the following...
Add a method in the BST class to return the number of the nonleaves as follows: /** Returns the number of nonleaf nodes */ public int getNumberofNonLeaves()
Implement the postorder method in BST using a stack instead of recursion. Write a test program that prompts the user to enter 10 integers, stores them in a BST, and invokes the postorder method to...
Design a class named Time. The class contains:??The data fields?hour,?minute, and?second?that represent a time.? A no-arg constructor that creates a Time object for the current time. (The values of...
A bounding rectangle is the minimum rectangle that encloses a set of points in a two-dimensional plane, as shown in Figure. Write a method that returns a bounding rectangle for a set of points in a...
Write a program that converts the Java source code from the next-line brace style to the end-of-line brace style. For example, the following Java source in (a) uses the next-line brace style. Your...
The text introduced Prims algorithm for finding a minimum spanning tree. Kruskals algorithm is another well-known algorithm for finding a minimum spanning tree. The algorithm repeatedly finds a...
Implement the following method using Fork/Join to find the sum of a list. public static double parallelSum(double[] list) Write a test program that finds the sum in a list of 9,000,000 double values.
Modify the Loan class in Listing 10.2 to throw IllegalArgumentException if the loan amount, interest rate, or number of years is less than or equal to zero. Listing 1 public class Loan { 2 private...
Rewrite the PrintCalendar class in Listing 6.12 to display a calendar for a specified month using the Calendar and GregorianCalendar classes. Your program receives the month and year from the command...
Write pseudocode for the procedures HEAP-MINIMUM, HEAP-EXTRACT-MIN, HEAP-DECREASE-KEY, and MIN-HEAP-INSERT that implement a min-priority queue with a min-heap.
Argue that for any constant 0 < 1/2, the probability is approximately 1 - 2 that on a random input array, PARTITION produces a split more balanced than 1 to .
Write a program that displays a clock and sets the time with the input from three text fields, as shown in Figure 16.38b. Use the ClockPane in Listing 14.21. Resize the clock to the center of the...
Consider a hash table of size m = 1000 and a corresponding hash function h(k) = m(kA mod 1) for A = (5 1)/2. Compute the locations to which the keys 61, 62, 63, 64, and 65 are mapped.
Consider n chords on a circle, each defined by its endpoints. Describe an O(n lg n)- time algorithm to determine the number of pairs of chords that intersect inside the circle. (For example, if the n...
Determine the cost and structure of an optimal binary search tree for a set of n = 7 keys with the following probabilities: 1 0.04 0.06 i 3 4 5 6. 7 Pi 0.08 0.02 0.10 0.12 0.14 0.06 0.06 0.06 0.06...
Suppose a file named Exercise17_07.dat has been created using the ObjectOutputStream. The file contains Loan objects. The Loan class in Listing 10.2 does not implement Serializable. Rewrite the Loan...
Show that the Bellman-Ford algorithm, when run on the constraint graph for a system Ax b of difference constraints, minimizes the quantity (max {x i } min {x i }) subject to Ax b. Explain how this...
The Loan class in Listing 10.2 does not implement Serializable. Rewrite the Loan class to implement Serializable. Write a program that creates five Loan objects and stores them in a file named...
Prove that matrix inverses are unique, that is, if B and C are inverses of A, then B = C.
Revise BST in Listing 25.5, using a generic parameter and a Comparator for comparing objects. Define a new constructor with a Comparator as its argument as follows:BST(Comparator comparator) Listing...
Write a short Java method, inputAllBaseTypes, that inputs a different value of each base type from the standard input device and prints it back to the standard output device.
Design and write a complete test program to test if the BST class in Listing 25.5 meets all requirements. Listing 1 public class BST 2 extends AbstractTree { protected TreeNode root; protected int...
The MyLinkedList class used in Listing 24.6 is a one-way directional linked list that enables one-way traversal of the list. Modify the Node class to add the new data field name previous to refer to...
Design and write a complete test program to test if the MyLinkedList class in Listing 24.6 meets all requirements. Listing 1 public class MyLinkedList extends MyAbstractlist { private Node head,...
Design and write a complete test program to test if the MyArrayList class in Listing 24.3 meets all requirements. Listing 1 public class MyArrayList extends MyAbstractList { public static final int...
Revise Heap in Listing 23.9, using a generic parameter and a Comparator for comparing objects. Define a new constructor with a Comparator as its argument as follows:Heap(Comparator comparator)...
The heap presented in the text is also known as a max-heap, in which each node is greater than or equal to any of its children. A min-heap is a heap in which each node is less than or equal to any of...
The problem for finding a largest block is described in Programming Exercise 8.35. Design a dynamic programming algorithm for solving this problem in O(n2) time. Write a test program that displays a...
Describe a way to use recursion to compute the sum of all the elements in an nn (two-dimensional) array of integers.
Write a recursive method that will output all the subsets of a set of n elements (without repeating any subsets).
Give a recursive definition of a singly linked list class that does not use any Node class.
Let H be a heap storing 15 entries using the array-based representation of a complete binary tree. What is the sequence of indices of the array that are visited in a preorder traversal of H? What...
Rewrite Listing 12.18, WebCrawler.java, to improve the performance by using appropriate new data structures for listOfPendingURLs and listofTraversedURLs. Suppose you have Java source files under the...
Draw the binary tree representation of the following arithmetic expression: (((5+2) (21))/((2+9)+((72)1)) 8).
Modify Listing 20.6, MultipleBallApp.java to assign a random radius between 2 and 20 when a ball is created. When the - button is clicked, one of largest balls is removed. Listing 1 import...
Write a program that takes as input a fully parenthesized, arithmetic expression and converts it to a binary expression tree. Your program should display the tree in some way and also print the value...
Write a GUI application that lets the user enter a file name in the text field and press the Enter key to display its binary representation in a text area. The user can also modify the binary code...