Building Block Day Care Center charges varying weekly rates depending on the age of the child and the number of days per week the child attends, as shown in Table 8-5. Develop the logic for a program...
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
Create the logic for a program that computes hotel guest rates at Cornwalls Country Inn. Include two overloaded methods named computeRate(). One version accepts a number of days and calculates the...
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...
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. Create a class named Apartment that includes an apartment number, number of bedrooms, number of baths, and monthly rent. Include two overloaded constructors. The...
Complete the following tasks: a. Design a method that calculates the cost of boarding a horse at Delmar Stables. The method accepts a code for the type of boarding, S for self-care, which provides...
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...
Flesh out the details of an algorithmto eliminate left recursion and common prefixes in an arbitrary context-free grammar.
Consider the following LL(1) grammar for a simplified subset of Lisp: P E $$ E atom E ( E Es ) Es E Es (a) What is FIRST(Es)? FOLLOW(E)? PREDICT(Es )? (b) Give a parse tree for the string...
If foo is an abstract class in a C++ program, why is it acceptable to declare variables of type foo*, but not of type foo?
Consider mathematical operations in a language like C++, which supports both overloading and coercion. In many cases, it may make sense to provide multiple, overloaded versions of a function, one for...
Example 8.24, which considered the layout of a two-dimensional array of characters, counted only the space devoted to characters and pointers. This is appropriate if the space is allocated...
Write an LL(1) grammar with action routines and automatic attribute space management that generates the reverse Polish translation described in Exercise 4.7. Data From Exercise 4.7: Suppose that we...
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...
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 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...
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...
Open the VB2015\Chap06\Multiplication Solution (Multiplication Solution.sln) file. Code the application to display a multiplication table similar to the one shown in Figure 6-31. Use the For...Next...
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...
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?
What undesirable dependencies are avoided when a relation is in 2NF?
Discuss the different measures of transaction equivalence. What is the difference between conflict equivalence and view equivalence?
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...
Explain the role of middleware in client/server computing.
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?
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...
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...
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,...
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....
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...
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,...
Jim Watanabe was in his new car, driving down I-5, on his way to work. He dreaded the phone call he knew he was going to have to make. The original go-live date for a pilot implementation of Petrie...
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...
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...
Which of the following do not need to have their names changed to more meaningful ones? a. All controls that will be coded b. All controls that will be referred to in code c. The form d. Identifying...
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...
(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...
Show how the following values would be stored by byte-addressable machines with 32-bit words, using little endian and then big endian format. Assume that each value starts at address 10 16 . Draw a...
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 *** +...
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 a table similar to that shown in Figure 3.10, calculate 74 divided by 21 using the hardware described in Figure 3.11. You should show the contents of each register on each step. Assume A and B...
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).
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...
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...