Question Answers
Textbooks
Search Textbook questions, tutors and Books
Oops, something went wrong!
Change your search query and then try again
Toggle navigation
FREE Trial
S
Books
FREE
Study Help
Expert Questions
Accounting
General Management
Mathematics
Finance
Organizational Behaviour
Law
Physics
Operating System
Management Leadership
Sociology
Programming
Marketing
Database
Computer Network
Economics
Textbooks Solutions
Accounting
Managerial Accounting
Management Leadership
Cost Accounting
Statistics
Business Law
Corporate Finance
Finance
Economics
Auditing
Hire a Tutor
AI Tutor
AI Flashcards
FREE
Search
Search
Sign In
Register
study help categories
/
Computer science
Top Selling Computer science Questions
In a two-dimensional array declared as num myArray[6][7], the highest row number is ______. a. 5 b. 6 c. 7 d. 8
If you access a two-dimensional array with the expression output myArray[2][5], the output value will be _____. a. 0 b. 2 c. 5 d. Impossible to tell from the information given
Assume you have written a method with the header string myMethod(num score, string grade). Also assume you have declared a numeric variable named test. Which of the following is a correct method...
Programmers should strive to _____. a. Increase coupling b. Increase cohesion c. Both of the above d. Neither a nor b
Create the logic for a program that prompts a user for 12 numbers and stores them in an array. Pass the array to a method that reverses the order of the numbers. Display the reversed numbers in the...
Each of the programs in Figure 9-25 uses a recursive method. Try to determine the output in each case. a. b. c. start start start output recursiveA(0) stop num recursiveA(num x) num result if x = 0...
The process of acquiring the traits of ones predecessors is ________. a. Polymorphism b. Encapsulation c. Inheritance d. Orientation
An instance method ________. a. Is static b. Receives a this reference c. Both of the above d. None of the above
Assume that you have created a class named Dog that contains a data field named weight and an instance method named setWeight(). Further assume that the setWeight() method accepts a numeric parameter...
A static method is also known as a(n) ________ method. a. Instance b. Class c. Private d. Public
By default, methods contained in a class are ________methods. a. Static b. Nonstatic c. Class d. Public
Assume that you have created a class named MyClass, and that a working program contains the following statement: output MyClass.numberOfStudents Which of the following do you know? a....
Assume that you have created an object named myObject and that a working program contains the following statement: output myObject.getSize() Which of the following do you know? a. getSize() is a...
Assume that you have created a class that contains a private field named myField and a nonstatic public method named myMethod(). Which of the following is true? a. myMethod() has access to myField...
An object can be ________. a. Stored in an array b. Passed to a method c. Returned from a method d. All of the above
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...
Which of the following is not a similarity between constructors and destructors? a. Both can be called automatically. b. Both can be overloaded. c. Both have the same name as their class. d. Both...
A class that is used as a basis for inheritance is called a _________. a. Derived class b. Subclass c. Base class d. Child class
Which of the following is not an advantage of creating a class that inherits from another class? a. You make it easier for anyone who has used the original class to understand the new class. b. You...
In object-oriented programs, errors are known as ____________. a. Faults b. Gaffes c. Exceptions d. Omissions
Use the construction in the proof of Theorem 1.45 to give the state diagrams of NFAs recognizing the union of the languages described in a. Exercises 1.6a and 1.6b. b. Exercises 1.6c and 1.6f....
This exercise concerns TM M 1 , whose description and state diagram appear in Example 3.9. In each of the parts, give the sequence of configurations that M1 enters when started on the indicated input...
Give an example in the spirit of the recursion theorem of a program in a real programming language (or a reasonable approximation thereof ) that prints itself out.
A local zoo offers three different memberships: an individual membership for $99 per year, a dual membership for $175 per year, and a family membership for $225 per year. The membership director...
Write an application that allows a user to enter any number of student test scores until the user enters 999. If the score entered is less than 0 or more than 100, display\ an appropriate message and...
Write an application that prompts a user for a full name and street address and constructs an ID from the users initials and numeric part of the address. For example, the user William Henry Harrison...
Allow a user to enter any number of double values up to 20. The user should enter 99999 to quit entering numbers. Display an error message if the user quits without entering any numbers; otherwise,...
Write an application that extends JPanel and displays a phrase in every font size from 6 through 20. Save the file as JFontSizesPanel.java.
You wrote an application named DistanceFromAverage that allows a user to enter up to 20 double values and then displays each entered value and its distance fromthe average. Now,modify that programto...
You set up the card game Concentration by placing pairs of cards face down in a grid. The player turns up two cards at a time, exposing their values. If the cards match, they are removed from the...
From your own experience, describe an activity that would not have been possible without computers.
Write a program that doesnt do anything, but declares a number of variables with legal and illegal names (such as int double = 0;), so that you can see how the compiler reacts.
What do x&&y and x||y, respectively, mean?
Build an ad hoc scanner for the calculator language. As output, have it print a list, in order, of the input tokens. For simplicity, feel free to simply halt in the event of a lexical error.
Write a program in your favorite scripting language to remove comments from programs in the calculator language.
Consider the following grammar: G S $$ S A M M S | A a E | b A A E a B | b A | B b E | a B B (a) Describe in English the language that the grammar generates. (b) Show a parse tree for the...
Consider the language consisting of all strings of properly balanced parentheses and brackets. (a) Give LL(1) and SLR(1) grammars for this language. (b) Give the corresponding LL(1) and SLR(1)...
Refer back to the context-free grammar. Add attribute rules to the grammar to accumulate into the root of the tree a count of the maximum depth to which parentheses are nested in the program string....
We noted in Section 6.1.1 that most binary arithmetic operators are left associative in most programming languages. In Section 6.1.4, however, we also noted that most compilers are free to evaluate...
Translate the following expression into postfix and prefix notation: [b + sqrt(b b 4 a c)]/(2 a) Do you need a special symbol for unary negation?
Describe a plausible scenario in which a programmer might wish to avoid short-circuit evaluation of a Boolean expression.
Consider the following context-free grammar. G G B G N B ( E ) E E ( E ) N ( L ] L L E L ( (a) Describe, in English, the language generated by this grammar. (Your description should be a...
Write a C++ preorder iterator to supply tree nodes to the loop in Example 6.69. You will need to know (or learn) how to use pointers, references, inner classes, and operator overloading in C++. For...
In Example 7.53 we mentioned three ways to make the need for comparisons more explicit when defining a generic sort routine in C++: make the comparison routine a method of the generic parameter class...
Consider the following pseudocode: What does this programprint if the language uses static scoping? What does it print with dynamic scoping? Why? x: integer -- global procedure set xln : integer) x:=...
Consider the following pseudocode: x : integer global procedure set x(n : integer) x := n procedure print x() write integer(x) procedure foo(S, P : function; n : integer) x : integer := 5 if n in...
Modify the grammar of Figure 2.25 so that it accepts only programs that contain at least one write statement. Make the same change in the solution to Exercise 2.17. Based on your experience, what do...
Consider the following grammar for reverse Polish arithmetic expressions: E E E op | id op + | - | * | / Assuming that each id has a synthesized attribute name of type string, and that each E and...
Consider the following CFG for floating-point constants, without exponential notation. (Note that this exercise is somewhat artificial: the language in question is regular, and would be handled by...
Continuing the previous exercise, suppose that A has row-pointer layout, and that i, j, and k are again available in registers. Show pseudo assembler code to load A[i, j, k] into a register. Assuming...
Consider the array indexing calculation of Example 8.25. Suppose that i, j, and k are already loaded into registers, and that As elements are integers, allocated contiguously in memory on a 32-bit...
Revise the algorithm of Figure 6.6 so that it performs an in-order enumeration, rather than preorder. Figure 6.6: class BinTree implements Iterable { BinTree left; BinTree right; T val; // other...
Use iterators to construct a program that outputs (in some order) all structurally distinct binary trees of n nodes. Two trees are considered structurally distinct if they have different numbers of...
(a) Give a generic solution to Exercise 6.19. Data From Exercise 6.19: Write a C++ preorder iterator to supply tree nodes to the loop in Example 6.69. You will need to know (or learn) how to use...
In Example 11.59 we showed how to implement interactive I/O in terms of the lazy evaluation of streams. Unfortunately, our code would not work as written, because Scheme uses applicative-order...
Modify the method that calculates the sum of the integers between 1 and N shown in this chapter. Have the new version match the following recursive definition: The sum of 1 to N is the sum of 1 to...
Explain how to extend Figure 8.7 to accommodate subroutine arguments that are passed by value, but whose shape is not known until the subroutine is called at run time. sp- Ada: -- procedure foo (size...
Write a switch statement to convert a letter grade into an equivalent numeric value on a fourpoint scale. Set the value of the variable gradeValue to 4.0 for an A, 3.0 for a B, 2.0 for a C, 1.0 for a...
Write a program that simulates a bouncing ball by computing its height in feet at each second as time passes on a simulated clock. At time zero, the ball begins at height zero and has an initial...
We fixed justvowels so that it works with lowercase or uppercase vowels. Fix notvowels so that it doesnt print out uppercase vowels. (Try it as it is in the chapter, and you will see that it does...
Write a function to convert Celsius to Fahrenheit.
Write a general scaleUp function that takes in any picture and creates and returns a new picture twice as big using makeEmptyPicture(width,height).
Write a method called repl that accepts a String and a number of repetitions as parameters and returns the String concatenated that many times. For example, the call repl( "hello", 3) should return...
The next five questions refer to the following String elements: ["It", "was", "a", "stormy", "night"] Write the code to declare an ArrayList containing these elements. What is the size of the list?...
Write a recursive method called dedup that takes a string as a parameter and that returns a new string obtained by replacing every sequence of repeated adjacent letters with just one of that letter....
Write a denotational semantics mapping function for the following statements: a. Ada for b. Java do-while c. Java Boolean expressions d. Java for
What problem do we encounter when we try to construct an array of type E? How do we resolve this problem?
Define exception, exception handler, raising an exception, continuation, finalization, and built-in exception.
Extracting characters or substrings from a larger text string is known as __________. a. Parsing b. Compiling c. Rendering d. Stripping
The starting value of an algorithm used to generate a range of random numbers is called the _________.
In a binary search of an array named MyArray, the first time the program runs, the value of Low will be ____________.
Consider the following program written in C syntax: For each of the following parameter- passing methods, what are all of the values of the variables value and list after each of the three calls to...
Which function temporarily converts a string to a number and then returns the number? a. Format b. FormatNumber c. String d. Val
In this exercise, you modify one of the Concert Tickets applications from Lesson A. Use Windows to make a copy of the Concert Solution-Function folder. Rename the copy Concert Solution-Intermediate....
In this exercise, you modify the Favorites application from Lesson A. Use Windows to make a copy of the Favorites Solution folder. Rename the copy Favorites Solution-Intermediate. Open the Favorites...
Open the VB2015\Chap04\Debug Solution\Debug Solution (Debug Solution.sln) file. Open the Code Editor window and review the existing code. The btnCalc_Click procedure should calculate a 5% commission...
In this exercise, you modify the application from Exercise 5. Use Windows to make a copy of the Guessing Game Solution folder. Rename the copy Modified Guessing Game Solution. Open the Guessing Game...
In Listing 19.1, GenericStack is implemented using composition. Define a new stack class that extends ArrayList. Draw the UML diagram for the classes then implement GenericStack. Write a test program...
Write a program that prompts the user to enter a text file name and displays the number of vowels and consonants in the file. Use a set to store the vowels A, E, I, O, and U.
Write a program that displays a tic-tac-toe board, as shown in Figure 31.48b. A cell may be X, O, or empty. What to display at each cell is randomly decided. The X and O are images in the files x.gif...
What does the following program print? public class Mystery { public static void main(String[] args) { int x = 1; int total = 0; while (x
There are several differences between the coding standards listed in this chapter. Give an explanation for these differences.
Discuss why some systems developers believe that a data model is one of the most important parts of the statement of information system requirements.
A SPARC implementation has K register windows. What is the number N of physical registers?
Write a program that reads a graph from a file and determines whether the graph is connected. The first line in the file contains a number that indicates the number of vertices (n). The vertices are...
Printing a grid. Write a program that prints the following grid to play tic-tac-toe. Of course, you could simply write seven statements of the form System.out.println("+--+--+--+"); You should do it...
Discuss how each of the following features is realized in SQL 2008: object identifier, type inheritance, encapsulation of operations, and complex object structures.
Consider the universal relation R = {A, B, C, D, E, F, G, H, I, J} and the set of functional dependencies F = {{A, B}{C}, {A}{D, E}, {B}{F}, {F}{G, H}, {D}{I, J}}. What is the key for R? Decompose R...
Design a Customer class to handle a customer loyalty marketing campaign. After accumulating $100 in purchases, the customer receives a $10 discount on the next purchase. Provide methods void...
What are logical data warehouses? Do an online search for the data virtualization platform from Cisco, and disvcuss how it will help in building a logical data warehouse?
What is information technology, and why is it important to society?
What is the function of a DFD in the SDLC?
Draw a use case diagram for the following situation (state any assumptions you believe you have to make in order to develop a complete diagram). Then convert the use case diagram into a sequence...
What functions do routers, gateways, and proxy servers serve in a network?
Review Section 8.2 and the comments about EHR usability. Research the current status of EHR usability and describe all noteworthy developments.
What is the primary objective of the evaluation and selection team in selecting a development strategy?
What is outsourcing?
What are the differences between in-house e-commerce development with packaged solutions and service providers?
Consider the ER diagram shown in Figure 3.22 for part of a BANK database. Each bank can have multiple branches, and each branch can have multiple accounts and loans. a. List the strong (nonweak)...
Consider the library relational database schema in Figure 6.6. Write a program segment that retrieves the list of books that became overdue yesterday and that prints the book title and borrower name...
Showing 2200 - 2300
of 5000
First
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
Last