Create a simple math game for children. Use a CSS file to make the design appealing to a young child. Allow the user to type two numbers into two text fields, and then to select the operation...
Perform a similar analysis for method Loop2 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...
Suppose you work for a company, iPuritan.com, that has strict rules for when two employees, x and y, may date one another, requiring approval from their lowestlevel common supervisor. The employees...
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 list-based representation of the sets that...
Suppose G is a weighted, connected, undirected graph and e is a smallest-weight edge in G. Show that there is a minimum spanning tree of G that contains e.
Builders Inc. wants a program that allows its salesclerks to enter the diameter of a circle and the price of railing material per foot. The program should calculate and display the total price of the...
Snarled program logic is called _____________ code. a. Snake b. Spaghetti c. Linguini d. Gnarly
A group of statements that executes as a unit is a _____________. a. Block b. Family c. Chunk d. Cohort
In a selection structure, the structure-controlling condition is______________. a. Tested once at the beginning of the structure b. Tested once at the end of the structure c. Tested repeatedly until...
Looking up a word in a dictionary can be a complicated process. For example, assume that you want to look up logic . You might open the dictionary to a random page and see juice . You know this word...
The Drive-Rite Insurance Company provides automobile insurance policies for drivers. Design a flowchart or pseudocode for following: a. A program that accepts insurance policy data, including a...
Mark Daniels is a carpenter who creates personalized house signs. He wants an application to compute the price of any sign a customer orders, based on the following factors: The minimum charge for...
10. Black Dot Printing is attempting to organize carpools to save energy. Each input record contains an employees name and town of residence. Ten percent of the companys employees live in Wonder...
When two loops are nested, the loop that is contained by the other is the _______________loop. a. Captive b. Unstructured c. Inner d. Outer
Overriding a users entered value by setting it to a predetermined value is known as _______________. a. Forcing b. Accumulating c. Validating d. Pushing
To ensure that a users entry is the correct data type, frequently you _______________. a. Prompt the user to verify that the type is correct b. Use a method built into the programming language c....
A subscript is a(n) _________. a. Element in an array b. Alternate name for an array c. Number that represents the highest value stored within an array d. Number that indicates the position of an...
Suppose that you have declared a numeric array named values that has 13 elements. Which of the following must be true? a. values[0] is smaller than values[1] b. values[2] is stored adjacent to...
Suppose that you have declared a numeric array named numbers, and two of its elements are numbers[1] and numbers[4]. You know that ________. a. numbers[4] is larger than numbers[1] b. The array has...
Suppose that you have declared an array as follows: num values[4] = 0, 0, 0, 0. Which of the following is an allowed operation? a. values[4] = 80 b. values[2] = values[4] values[0] c. output...
Two arrays in which each element in one array is associated with the element in the same relative position are ____________. a. Cohesive b. Parallel c. Hidden d. Perpendicular
In most modern programming languages, the highest subscript you should use with a 12-element array is ____________. a. 10 b. 11 c. 12 d. 13
Each element in a seven-element array can hold ________value(s). a. One b. Seven c. At least seven d. An unlimited number of
Create the logic for a Magic 8 Ball game in which the user enters a question such as What does my future hold? The computer randomly selects one of eight possible vague answers, such as It remains to...
If necessary, create a new project named Introductory21 Project and save it in the Cpp8\Chap14 folder. Also create a new source file named Introductory21.cpp. If you are using Microsoft Visual C++,...
The Apgar Medical group keeps a patient file for each doctor in the office. Each record contains the patients first and last name, home address, and birth year. The records are sorted in ascending...
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...
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...
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)
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...
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...
Flesh out the details of an algorithmto eliminate left recursion and common prefixes in an arbitrary context-free grammar.
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...
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 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 {......
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...
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...
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?
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...
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...
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?
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...
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....
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...
What are the five steps in the software acquisition process?
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...
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...