2 Implement the functions from Exercise 5.51 using a 4 8 3 PLA. You may use dot notation.
Give three examples from the MIPS architecture of each of the architecture design principles: (1) simplicity favors regularity (2) make the common case fast (3) smaller is faster (4) good design...
Explain how the following program can be used to determine whether a computer is big-endian or little-endian:? li $t0, 0XABCD9876 Sw $t0, 100( $0) lb $s5, 101($0)
In less than one page, describe four everyday activities that exhibit temporal or spatial locality. List two activities for each type of locality, and be specific.
Repeat Exercise 8.9 for the following repeating sequence of lw addresses (given in hexadecimal) and cache configurations. The cache capacity is still 16 words. 74 A0 78 38C AC 84 88 8C 7C 34 38 13C...
Using a diagram similar to Figure 7.52, show the forwarding and stalls needed to execute the following instructions on the pipelined MIPS processor.? add $t0, $s0, $s1 sub $t0, $t0, $s2 $t1, 60( $t0)...
How many cycles are required for the pipelined MIPS processor to issue all of the instructions for the program in Exercise 7.23? What is the CPI of the processor on this program?? Data from Problem...
Write a SQL statement to display all columns of all rows of PET. Do not use the asterisk (*) notation. PET_OWNER ( OwnerID , OwnerLastName, OwnerFirstName, OwnerPhone, OwnerEmail) PET ( PetID ,...
The James River Jewelry Project Questions are available online for Appendix D, which can be downloaded from the textbook?s Web site: www.pearsonhighered.com/kroenke . The solutions for these...
Write a SQL statement to display the breed and type of all pets. PET_OWNER ( OwnerID , OwnerLastName, OwnerFirstName, OwnerPhone, OwnerEmail) PET ( PetID , PetName, PetType, PetBreed, PetDOB,?...
Write an SQL statement to display the OwnerLastName, OwnerFirstName, PetName, PetType, PetBreed, and AverageLifeExpectancy for pets with a known PetBreed. PET_OWNER ( OwnerID , OwnerLastName,...
In Chapter 14, you created an interactive GUI version of Carlys Catering. Now, rewrite the program using JavaFX and Scene Builder. Allow the user to enter the number of guests for an event into a...
In Chapter 14, you created an interactive GUI version for Sammys Seashore Rentals. Now, rewrite the program using JavaFX and Scene Builder that allows the user to enter a rental time in hours into a...
Order the following list of functions by the big-Oh notation. Group together (for example, by underlining) those functions that are big-Theta of one another.
Show that the summation ENog, i] is O(n log n)
Show that the summation . You may assume that n is a power of 2. E log2(n/i)] is O(n)
Which of the following is not an E-R model relationship? a. Some-to-many b. One-to-one c. One-to-many d. Many-to-many
Create and execute SQL statements to perform the following actions, using the JustLee Books database: 1. Create a new user account. The account name should be a combination of your first initial and...
Why are functions in this chapter referred to as single-row functions?
Whats the name of the table provided by Oracle 11g for completing queries that dont involve a table? a. DUMDUM b. DUAL c. ORAC d. SYS
Describe the structure and pseudocode for an array-based implementation of an index-based list that achieves O(1) time for insertions and removals at index 0, as well as insertions and removals at...
Give an O(n)-time algorithm for computing the depth of all the nodes of a tree T, where n is the number of nodes of T.
Suppose you are given the array A = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12], and you then perform the binary search algorithm given in this chapter to find the number 8. Which numbers in the array A...
Suppose you work for a computer game company, which is designing a first person shooting game. In this game, players stand just outside of a circular playing field and shoot at targets inside the...
Perform a similar analysis for method Loop3 shown in Algorithm 1.21. Algorithm Loop1(n): s-0 for i + 1 to n do s-s+i Algorithm Loop2(n): p-1 for i - 1 to 2n do p-p.i Algorithm Loop3(n): p-1 for i +1...
How many walls were erased to construct the maze in Figure 7.3, not counting the start and finish walls? Figure 7.3
Sports announcers are expected to keep talking during a broadcast of a sporting event even when there is nothing actually happening, such as during half-time. One common way to fill empty time is...
Let A be a collection of objects. Describe an efficient method for converting A into a set. That is, remove all duplicates from A. What is the running time of this method?
Suppose we have 20 singleton sets, numbered 0 through 19, and we call the operation union(find(i),find(i + 5)), for i = 0, 1, 2,..., 14. Draw a picture of a tree-based representation of the sets that...
Another problem of interest in percolation theory is to determine the threshold probability where a liquid will permeate a porous material. One way to model this is to consider the barriers between...
Provide an example instance of the fractional knapsack problem where a greedy strategy based on repeatedly choosing as much of the highest-benefit item as possible results in a suboptimal solution.
Suppose we are given a set of tasks specified by pairs of the start times and finish times as T = {(1, 2),(1, 3),(1, 4),(2, 5),(3, 7),(4, 9),(5, 6),(6, 8),(7, 9)}. Solve the task scheduling problem...
Suppose that the coins of the fictional country of Combinatoria come in the denominations, d 1 , d 2 ,...,d k , where d 1 = 1 and the other d i values form a set of distinct integers greater than 1....
Sally is hosting an Internet auction to sell n widgets. She receives m bids, each of the form I want k i widgets for d i dollars, for i = 1, 2,...,m. Characterize her optimization problem as a...
Tamarindo University and many other schools worldwide are doing a joint project on multimedia. A computer network is built to connect these schools using communication links that form a free tree....
Suppose the football coach for the Anteaters has heard about your abilities to solve challenging problems and has hired you to write a computer program that can decide which of their many trophies to...
Show that every language L in P is polynomial-time reducible to the language M = {5}, that is, the language that simply asks whether the binary encoding of the input is equal to 5.
Show how to construct a Boolean circuit C such that, if we create variables only for the inputs of C and then try to build a Boolean formula that is equivalent to C, then we will create a formula...
Consider the problem DNF-DISSAT, which takes a Boolean formula S in disjunctive normal form (DNF) as input and asks whether S is dissatisfiable, that is, there is an assignment of Boolean values to...
Draw an example of a graph with 10 vertices and 15 edges that has a clique of size 6.
Given a set P of n points, design an efficient algorithm for constructing a simple polygon whose vertices are the points of P.
Show how to modify the KMP string pattern matching algorithm so as to find every occurrence of a pattern string P that appears as a substring in T, while still running in O(n + m) time. (Be sure to...
Using only the instructions shown in Figure 1-10, create an algorithm that displays the average of four numbers. Be sure to indent the instructions appropriately. calculate the average by dividing...
A program uses a char variable named department and two double variables named salary and raise. The department variable contains one of the following letters (entered in either uppercase or...
How many times will the computer process the cout statement in the following code? for (int numTimes = 1; numTimes < 10; numTimes += 2) cout < < numTimes < < endl; //end for a. 0 b. 5 c. 6 d. 9
Write an assignment statement that updates an accumulator variable named totalPay by the value in the grossPay variable.
Write an assignment statement that updates a counter variable named quantity by 5.
Which of the following updates the total accumulator variable by the value in the sales variable? a. total = total + sales; b. total = sales + total; c. total += sales; d. All of the above
Write the C++ code to display the integers 15, 12, 9, 6, 3, and 0 on separate lines on the computer screen. Use the for statement and an int variable named num.
If necessary, create a new project named Intermediate25 Project and save it in the Cpp8\Chap13 folder. Also create a new source file named Intermediate25.cpp. Write a program that accepts a string of...
If necessary, create a new project named Introductory21 Project and save it in the Cpp8\Chap13 folder. Also create a new source file named Introductory21.cpp. Write a program that allows the user to...
Modify the solution shown earlier in Figure 7-2. The solution should now keep track of the number of times Sahirahs laser beam missed the spider. After saying You are safe now. The spider is dead.,...
Use the nums array to answer. The array was declared using the int nums[4] = {10, 5, 7, 2}; statement. The x and total variables are int variables and are initialized to 0. The avg variable is a...
A message that asks a user for input is a(n) ___________. a. Eomment b. Echo c. Prompt d. Declaration
Your downloadable files for Chapter 2 include DEBUG02-01.txt, DEBUG02-02. txt, and DEBUG02-03.txt. Each file starts with some comments that describe the problem. Comments are lines that begin with...
Your downloadable files for Chapter 2 include a file named DEBUG02-04.jpg that contains a flowchart with syntax and/or logical errors. Examine the flowchart and then find and correct all the bugs.
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...
A programmers most important task before planning the logic of a program is to ____________. a. Decide which programming language to use b. Code the problem c. Train the users of the program d....
A program contains a seven-element array that holds the names of the days of the week. At the start of the program, you display the day names using a subscript named dayNum. You display the same...
Trainers at Toms Athletic Club are encouraged to enroll new members. Write an application that allows Tom to enter the names of each of his 25 trainers and the number of new members the trainer has...
a. Design an application in which the number of days for each month in the year is stored in an array. (For example, January has 31 days, February has 28, and so on. Assume that the year is not a...
Your downloadable files for Chapter 6 include a file named DEBUG06-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 is true regarding the data hierarchy? a. Fields contain records. b. Characters contain fields. c. Fields contain files. d. Files contain records.
Gimme Shelter Roofers maintains a file of past customers, including a customer number, name, address, date of job, and price of job. It also maintains a file of estimates given for jobs not yet...
Three-dimensional arrays _____. a. Are supported in many modern programming languages b. Always contain at least nine elements c. Are used only in object-oriented languages d. All of the above
Student records are stored in ID number order, but accessed by grade point average for a report. Grade point average order is a(n) _____ order. a. Imaginary b. Physical c. Logical d. Illogical
When you store a list of key fields paired with the storage address for the corresponding data record, you are creating _____. a. A directory b. A three-dimensional array c. A linked list d. An index
Assume you have written a method with the header void myMethod(num a, string b). Which of the following is a correct method call? a. MyMethod(12) b. MyMethod("Goodbye") c. MyMethod(12, "Hello") d. It...
Assume you have written a method with the header num yourMethod(string name, num code). The methods type is _____. a. Num b. String c. Num and string d. Void
Create the logic for a program that prompts a user for 20 numbers and stores them in an array. Pass the array to a method that calculates the arithmetic average of the numbers and returns the value...
Your downloadable files for Chapter 9 include DEBUG09-01.txt, DEBUG09-02.txt, and DEBUG09-03.txt. Each file starts with some comments that describe the problem. Comments are lines that begin with two...
Design a class named TermPaper that holds an authors name, the subject of the paper, and an assigned letter grade. Include methods to set the values for each data field and display the values for...
A file named MAINTENANCE10-01.txt is included with your downloadable student files. Assume that this program is a working program in your organization and that it needs modifications as described in...
Employing inheritance reduces errors because _________. a. The new classes have access to fewer data fields b. The new classes have access to fewer methods c. You can copy and paste methods that you...
Which of the following is true? a. A classs methods usually are public. b. A classs data fields usually are public. c. Both of the above d. None of the above
Write a formal description of the following graph. 1 4 2 3 6
Let = {1, 2, 3, 4} and C = {w * | in w, the number of 1s equals the number of 2s, and the number of 3s equals the number of 4s}. Show that C is not context free.
Say that a language is prefix-closed if all prefixes of every string in the language are also in the language. Let C be an infinite, prefix-closed, context-free language. Show that C contains an...
Modify the proof of Theorem 3.16 to obtain Corollary 3.19, showing that a language is decidable iff some nondeterministic Turing machine decides it. (You may assume the following theorem about trees....
Use the construction in the proof of Theorem 1.47 to give the state diagrams of NFAs recognizing the concatenation of the languages described in a. Exercises 1.6g and 1.6i. b. Exercises 1.6b and...
Use the construction in the proof of Theorem 1.49 to give the state diagrams of NFAs recognizing the star of the languages described in a. Exercise 1.6b. b. Exercise 1.6j. c. Exercise 1.6m. Exercise...
Review the way that we define sets to be the same size inDefinition 4.12 (page 203). Show that is the same size is an equivalence relation.
Read the informal definition of the finite state transducer given in Exercise 1.24. Give the state diagram of an FST with the following behavior. Its input and output alphabets are {0,1}. Its output...
This exercise concerns TM M 2 , whose description and state diagram appear in Example 3.7. In each of the parts, give the sequence of configurations that M 2 enters when started on the indicated...
Show that EQ CFG is undecidable.
In Theorem 3.21, we showed that a language is Turing-recognizable iff some enumerator enumerates it. Why didnt we use the following simpler algorithm for the forward direction of the proof? As...
Prove that there exists an undecidable subset of {1} * .
Show that P is closed under union, concatenation, and complement.
Show that NP is closed under union and concatenation.
Show that ALL DFA is in P.
Create a program that allows the user to enter the ages (in years) of five people. The program should display the average age. Use the for statement. Display the average age with one decimal place....
Jacob Weinstein wants a program that displays his savings account balance at the end of the month, given the beginning balance, total deposits, and total withdrawals. a. Using the chart shown earlier...
Rewrite the code from Pencil and Paper Exercise 4 using the do while statement in the outer loop and the while statement in the nested loop.
Rewrite the code from Pencil and Paper Exercise 2 using the replace function.
What is the output of the following code? b = 1; while(b < 4) { System.out.print(b + " "); b = b + 1; } a. 1 b. 1 2 3 c. 1 2 3 4 d. 1 1 1 1 1...
Karlton Learning wants a program that displays the amount of money a company owes for a seminar. The fee per person is based on the number of people the company registers, as shown in Figure 6-42....
What does the following statement output? for(a = 0; a < 5; ++a) System.out.print(a + " "); a. 0 0 0 0 0 b. 0 1 2 3 4 c. 0 1 2 3 4 5 d. Nothing
What does the following statement output? for(b = 1; b > 3; ++b) System.out.print(b + " "); a. 1 1 1 b. 1 2 3 c. 1 2 3 4 d. Nothing
In this exercise, you will modify the tip program shown earlier in Figure 7-31. Follow the instructions for starting C++ and viewing the ModifyThis16.cpp file, which is contained in either the...
Create a JFrame that holds five buttons with the names of five different fonts. Include a sixth button that the user can click to make a font larger or smaller. Display a demonstration JLabel using...