Filling an array with values during a programs execution is known as________ the array. a. Executing b. Colonizing c. Populating d. Declaring
Suppose that you want to write a program that inputs customer data including name, zipCode, balance, and regionNum. At the end of the program, a summary of the number of customers in each of 12 sales...
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
Suppose that an instructor assigns different letter grades based on points earned on a 10-point quiz, and that all scores have been verified to be between 0 and 10 inclusive. Also suppose that four...
When you use a subscript value that is negative or higher than the number of elements in an array, __________. a. Execution of the program stops and an error message is issued b. A value in a memory...
In every array, a subscript is out of bounds when it is ______________. a. Negative b. 0 c. 1 d. 999
You can access every element of an array using a ______________. a. While loop b. For loop c. Either of the above d. None of the above
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...
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. 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...
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...
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,...
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...
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...
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...
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...
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...
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 *** +...
(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...
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...