Show that any comparison-based sorting algorithm can be made to be stable, without affecting the asymptotic running time of this algorithm.
Show that we can solve the telescope scheduling problem in O(n) time even if the list of n observation requests is not given to us in sorted order, provided that start and finish times are given as...
If p is true and q is false, then ______________. a. p OR q is true b. p OR q is false c. p AND q is true d. p is greater than q
Design a flowchart or pseudocode for a program that accepts three numbers from a user and displays a message if the sum of any two numbers equals the third.
Create a lottery game application. Generate three random numbers, each between 0 and 9. Allow the user to guess three numbers. Compare each of the users guesses to the three random numbers and...
A report that lists only totals, with no details about individual records, is a(n) _______________ report. a. Accumulator b. Final c. Group d. Summary
What is output by each of the pseudocode segments in Figure 5-30? a. b. . a = 1 b - 2 C - 5 while a < c a = a + 1 b = b + c endwhile output a, b, c e = 6 f - 7 while d > f d - d + 1 e = e - 1...
Search the web to discover the ten most common user-selected passwords, and store them in an array. Design a program that prompts a user for a password, and continue to prompt the user until the user...
Create the logic for a program that accepts a users birth month and year and passes them to a method that calculates the users age in the current month and returns the value to the main program to be...
Assume that a working program contains the following statement: myDog.setName("Bowser") Which of the following do you know? a. setName() is a public method. b. setName() accepts a string parameter....
Complete the following tasks: a. Design a class named BaseballGame that has fields for two team names and a final score for each team. Include methods to set and get the values for each data field....
Complete the following tasks: a. Design a class named Circle with fields named radius, area, and diameter. Include a constructor that sets the radius to 1. Include get methods for each field, but...
Complete the C++ instructions column in Figure 3-25. The numbers of latex and Mylar balloons purchased will be integers. All of the remaining items will be real numbers. Use the int and double data...
In this exercise, you create a program for the sales manager at Computer Haven, a small business that offers motivational seminars to local companies. Figure 7-53 shows the charge for attending a...
Travel Tickets Company sells tickets for airlines, tours, and other travel-related services. Because ticket agents frequently mistype long ticket numbers, Travel Tickets has asked you to write an...
(a) Occasionally one encounters the suggestion that a garbage-collected language should provide a delete operation as an optimization: by explicitly delete-ing objects that will never be used again,...
Describe what this function does. Try different numbers as input. def test(num): if num > 0: return test(num-2) * test(num-1) else: return 0
Write a program that displays Pascals triangle: Use System.out.printf to format the output into fields of width 4. 1 1 1 3 4 6. 4 1 1 10 10 15 20 15 6 1 21 35 35 21 7 1 8. 28 56 70 56 28 8. 1 9. 36...
Write a program that produces images of Christmas trees as output. It should have a method with two parameters: one for the number of segments in the tree and one for the height of each segment. For...
Input a number (X) and create a program that allows the user to select finding the area (Area) of one of the following: The area of a square with side X, Area = X * X The area of a circle with...
An organization is in the process of upgrading microcomputer hardware and software for all employees. Hardware will be allocated to each employee in one of three packages. The first hardware package...
Consider the BANK ER schema in Figure 3.21, and suppose that it is necessary to keep track of different types of ACCOUNTS (SAVINGS_ACCTS, CHECKING_ACCTS, ) and LOANS (CAR_LOANS, HOME_LOANS, )....
In SQL, specify the following queries on the database in Figure 5.5 using the concept of nested queries and other concepts described in this chapter. a. Retrieve the names of all employees who work...
Under what circumstances should a systems analyst recommend an agile methodology over structured development or object-oriented analysis?
Suppose that the system crashes before the [write_item, T 2 , D, 25, 26] entry is written to the log in Figure 22.1(b). Will that make any difference in the recovery process? Figure 22.1(b) (b) A BCD...
Explore the emerging area of wearable computing, such as the Apple Watch, and comment on the impact of these devices on user interface design.
What is HCI?
What is the role of online documentation?
List the total number of lessons taught in 2018 by tutors in each of the three Status categories (Active, Temp Stop, and Dropped).
(i) Outline a 5TM that does decimal addition for three numbers simultaneously, the numbers being on tracks 2, 3, and 4. The sum should be left on track 5, and track 1 is reserved for carries. (ii)...
You are the latest contestant on Monty Halls game show, which has undergone a few changes over the years. In the game, there are n closed doors: behind one door is a car (U(car) = 1000), while the...
Write the Pitt Fitness database in DBDL notation.
Use anonymous FTP to connect to ftp.rfc-editor.org (directory innotes), and retrieve the RFC index. Also retrieve the protocol specifications for TCP, IP, and UDP.
(a) A sinusoid with a frequency of 2 Hz is applied to a sampler/zero-order hold combination. The sampling rate is 10 Hz. List all the frequencies present in the output that are less than 50 Hz. (b)...
Right before your function f from Exercise 2.34 returns, what do we know about contents of registers $t5, $s3, $ra, and $sp? Keep in mind that we know what the entire function f looks like, but for...
Using a table similar to that shown in Figure 3.6, calculate the product of the hexadecimal unsigned 8-bit integers 62 and 12 using the hardware described in Figure 3.5. You should show the contents...
The use of null values in a map is problematic, as there is then no way to differentiate whether a null value returned by the call get(k) represents the legitimate value of an entry (k,null), or...
Consider the inheritance of classes from Exercise R-2.12, and let d be an object variable of type Horse. If d refers to an actual object of type Equestrian, can it be cast to the class Racer? Why or...
Assume that a private internet requires that the messages at the application layer be encrypted and decrypted for security purposes. If we need to add some information about the encryption/decryption...
Byte-stuff the following frame payload in which E is the escape byte, F is the flag byte, and D is a data byte other than an escape or a flag character. DEDDF D D E|ED F|D
Assume a new character-oriented protocol is using the 16-bit Unicode as the character set. What should the size of the flag be in this protocol?
A multiple access network with a large number of stations can be analyzed using the Poisson distribution. When there is a limited number of stations in a network, we need to use another approach for...
Compute the fraction of the bandwidth that is wasted on overhead (headers and re-transmissions) for protocol 6 on a heavily loaded 50-kbps satellite channel with data frames consisting of 40 header...
What is the first principle we discussed in this chapter for protocol layering that needs to be followed to make the communication bidirectional?
We mentioned that two types of networks, datagram and virtual-circuit, need a routing or switching table to find the output port from which the information belonging to a destination should be sent...
Suppose you are to design a LAN for a company that has 100 employees, each given a desktop computer attached to the LAN. What should be the data rate of the LAN if the typical use of the LAN is shown...
In an 802.11 network, three stations (A, B, and C) are contending to access the medium. The contention window for each station has 31 slots. Station A randomly picks up the first slot; station B...
Assume that the network in Figure 20.34 uses distance-vector routing with the forwarding table as shown for each node. Figure 20.34 If each node periodically announces their vectors to the neighbor...
Write a program to simulate the sending-site FSMs for the simple protocol (Figure 23.18). Figure 23.18 FSMS for the simple protocol Request came from application. Packet arrived. Make a packet and...
In a connection, the value of cwnd is 3000 and the value of rwnd is 5000. The host has sent 2000 bytes, which have not been acknowledged. How many more bytes can be sent?
Repeat Example 25.4 using the service of TCP.
Modify, compile, and test the client program in Table 25.17 and the server program in Table 25.16 to allow the client to provide the pathname of a short file stored on the server host. The server...
Write a statement in Java to create a socket address bound to InetSocketAddress and the TELNET server process.
You think that a computer with the domain name aCollege.edu has several IP addresses. Write a statement in Java to create an array of InetAddress objects associated with this host.
Which clause is required in a SELECT statement? a. WHERE b. ORDER BY c. GROUP BY d. FROM e. all of the above
Which of the following queries creates a Cartesian join? a. SELECT title, authorid FROM books, bookauthor; b. SELECT title, name FROM books CROSS JOIN publisher; c. SELECT title, gift FROM books...
Which functions can be used to convert the letter case of character values?
Which of the following functions cant be used to convert the letter case of a character string? a. UPPER b. LOWER c. INITIALCAP d. All of the above can be used for case conversion.
Which of the following is a valid SQL statement? a. SELECT TRUNC (ROUND (125.38, 1), 0) FROM dual; b. SELECT ROUND (TRUNC (125.38, 0) FROM dual; c. SELECT LTRIM(LPAD (state, 5, ' '), 4, -3, "*") FROM...
JustLee Books has a problem: Book storage space is filling up. As a solution, management is considering limiting the inventory to only those books returning at least a 55% profit. Any book returning...
Which of the following SELECT statements lists only the book with the largest profit? a. SELECT title, MAX (retail-cost) FROM books GROUP BY title; b. SELECT title, MAX (retail-cost) FROM books GROUP...
Which of the following is correct? a. A group function can be nested inside a group function. b. A group function can be nested inside a single-row function. c. A single-row function can be nested...
Which of the following SELECT statements lists the highest retail price of all books in the Family category? a. SELECT MAX (retail) FROM books WHERE category = 'FAMILY'; b. SELECT MAX (retail) FROM...
Which of the following is not a valid statement? a. You must enter the ALL keyword in a group function to include all duplicate values. b. The AVG function can be used to find the average calculated...
Determine the average profit generated by orders in the ORDERS table.
Which of the following is a valid SELECT statement? a. SELECT order# FROM orders WHERE shipdate = SELECT shipdate FROM orders WHERE order# = 1010; b. SELECT order# FROM orders WHERE shipdate =...
Which of the following statements is valid? a. SELECT title FROM books WHERE retail < (SELECT cost FROM books WHERE isbn = '9959789321'); b. SELECT title FROM books WHERE retail = (SELECT cost FROM...
In which of the following situations is using a subquery suitable? a. When you need to find all customers living in a particular region of the country b. When you need to find all publishers who have...
Which of the following statements is correct? a. The IN comparison operator cant be usedwith a subquery that returns only one row of results. b. The equals (=) comparison operator cant be used with a...
Given the following query, which statement is correct? SELECT order# FROM orders WHERE order# IN (SELECT order# FROM orderitems WHERE isbn = '9959789321'); a. The statement doesnt execute because the...
In a wireless office environment, all calls are made between 8 am and 5 pm over the period of 24 hours. Assuming the number of calls to be uniformly distributed between 8 am and 5 pm, find the pdf of...
A receiver is tuned to 1 GHz transmission and receives signals with Doppler frequencies ranging from 10 Hz to 50 Hz when moving at a speed of 80 km/hr. What is the fading rate?
Explain carefully the purpose and use of the sequence number and acknowledgment number in connection-oriented communications. Create a multi packet example that illustrates exactly how these packets...
Skype uses super nodes, which do more work than ordinary P2P nodes. How do you think nodes become super nodes? There is nothing in the text that will help you with this question. Think broadly in...
Give a counterexample to the conjecture that if a directed graph G contains a path from u to , and if u.d < .d in a depth-first search of G, then is a descendant of u in the depth-first forest...
For the system in Part 1, consider the state variables v 1 (t) = y(t) v 2 (t)=y(t) + y(t) x(t) (a) Obtain the matrix A 2 and the vectors b 2 and c T 2 for the state and the output equations that...
A discrete-time IIR system is represented by the following difference equation y[n] = 0.15y[n2]+x[n], n 0 where x[n] is the input and y[n] is the output. (a) To find the impulse response h[n] of the...
Use the whois service at the American Registry for Internet Numbers (http://www.arin.net/whois) to determine the IP address blocks for three universities. Can the whois services be used to determine...
Assume a UNIX i-node requires a block of 60 bytes. How many disk blocks can be accessed using just direct, single, and double indirect indexing, as shown in Figure 17.9? Figure 17.9 file file...
The SDLC used in this text is based on what adaptive SDLC?
Write pseudocode agent programs for the goal-based and utility-based agents. The following exercises all concern the implementation of environments and agents for the vacuum-cleaner world.
Professor Gekko has always dreamed of inline skating across North Dakota. He plans to cross the state on highway U.S. 2, which runs from Grand Forks, on the eastern border with Minnesota, to...
The input of an LTI continuous-time system with impulse response h(t) = u(t) u(t 1) is (a) Find the output y(t) of the system using the convolution integral. (b) If T = 1, obtain and plot the system...
This exercise explores the differences between agent functions and agent programs. a. Can there be more than one agent program that implements a given agent function? Give an example, or show why one...
The most basic circuitry-level computer language is ____________. a. Machine language b. Java c. High-level language d. C++
Write a program that declares named constants to represent the number of inches, feet, and yards in a mile. Also declare a variable to represent a number of miles and assign a value to it. Compute...
Write an interactive version of the InchesToFeet class that accepts the inches value from a user. Save the class as InchesToFeetInteractive.java.
Suppose that you have created a program with only the following variables. int x = 2; int y = 3; Suppose that you also have a method with the following header: public static void mathMethod(int x)...
In Java, the value of (14 > 7) is ____________. a. True b. False c. 14 d. 7
What is the output of the following code segment? t = 0; if(t > 7) System.out.print("AAA"); System.out.print("BBB"); a. AAA b. BBB c. AAABBB d. Nothing
Assuming a variable f has been initialized to 5, which of the following statements sets g to 0? a. if(f > 6 || f == 5) g = 0; b. if(f < 3 || f > 4) g = 0; c. if(f >= 0 || f < 2) g = 0; d. All of the...
Assume that the population of Mexico is 128 million and that the population increases 1.01 percent annually. Assume that the population of the United States is 323 million and that the population is...
To create a String object, you can use the keyword ____________ before the constructor call, but you are not required to use this format. a. object b. create c. new d. char
The term that programmers use to describe objects that cannot be changed is ____________. a. Irrevocable b. Nonvolatile c. Immutable d. Stable
If you declare an array as follows, how do you indicate the final element of the array? int[] num = new int[6]; a. num[0] b. num[5] c. num[6] d. Impossible to tell
Write, compile, and test a class that uses the command window to display the following statement about comments: Program comments are nonexecuting statements you add to a file for documentation.Also...
Modify the Comments.java program in Exercise 10 so that the statement about comments is displayed in a dialog box. Save the class as CommentsDialog.java. Data from Exercise 10. Write, compile, and...
From 1925 through 1963, Burma Shave advertising signs appeared next to highways all across the United States. There were always four or five signs in a row containing pieces of a rhyme, followed by a...
Create an application that contains an enumeration that represents the days of the week. Display a list of the days, and then prompt the user for a day. Display business hours for the chosen day....
Create a class named CollegeCourse that includes data fields that hold the department (for example, ENG), the course number (for example, 101), the credits (for example, 3), and the fee for the...