Top Selling Computer science Questions

Consider the unbounded version of the regular 2D grid shown in Figure 3.9. The start state is at the origin, (0,0), and the goal state is at (x, y). a. What is the branching factor b in this state... Which of the following are true and which are false? Explain your answers. a. Depth-first search always expands at least as many nodes as A search with an admissible heuristic. b. h(n) = 0 is an... Chris considers four used cars before buying the one with maximum expected utility. Pat considers ten cars and does the same. All other things being equal, which one is more likely to have the better... Consider the following logic puzzle: In five houses, each with a different color, live five persons of different nationalities, each of whom prefers a different brand of candy, a different drink, and... Assume 151 and 214 are signed 8-bit decimal integers stored in twos complement format. Calculate 151 - 214 using saturating arithmetic. The result should be written in decimal. Show your work. Show how the value 0xabcdef12 would be arranged in memory of a little-endian and a big-endian machine. Assume the data is stored starting at address 0. This question deals with the properties of possible worlds, defined on page 488 as assignments to all random variables. We will work with propositions that correspond to exactly one possible world... Deciding to put probability theory to good use, we encounter a slot machine with three independent wheels, each producing one of the four symbols BAR, BELL, LEMON, or CHERRY with equal probability.... Consider two medical tests, A and B, for a virus. Test A is 95% effective at recognizing the virus when it is present, but has a 10% false positive rate (indicating that the virus is present, when it... Which of the following is not a primitive data type in Java? a. Boolean b. Byte c. Sector d. int In this exercise, we examine what happens to the probabilities in the umbrella world in the limit of long time sequences. a. Suppose we observe an unending sequence of days on which the umbrella... For the environment shown in Figure 17.1, find all the threshold values for R(s) such that the optimal policy changes when the threshold is crossed. You will need a way to calculate the optimal... Convert the QuartsToGallons program to an interactive application. Instead of assigning a value to the number of quarts, accept the value from the user as input. Save the revised program as... Write a program that selects a random number between 1 and 5 and asks the user to guess the number. Display a message that indicates the difference between the random number and the users guess.... Sammys Seashore Supplies rents beach equipment such as kayaks, canoes, beach chairs, and umbrellas to tourists. Write a program that prompts the user for the number of minutes he rented a piece of... In Java, methods must include all of the following except _____________. a. A call to another method b. A declaration c. Curly braces d. A body Which of the following could be the last legally coded line of a method declared as public static int getVal(double sum)? a. return; b. return 77; c. return 2.3; d. Any of these could be the last... If you declare a variable as an instance variable within a class, and you declare and use the same variable name within a method of the class, then within the method, _____________. a. The variable... A method variable _____________ a class variable with the same name. a. Acquiesces to b. Destroys c. Overrides d. Alters If a method is written to receive a double parameter, and you pass an integer to the method, then the method will _____________. a. Work correctly; the integer will be promoted to a double b. Work... A constructor _____________ overloaded. a. Must be b. Cannot be c. Can be d. Is always automatically Usually, you want each instantiation of a class to have its own copy of _____________. a. The data fields b. The class methods c. Both of the above d. None of the above The this reference _____________. a. Can be used implicitly b. Must be used implicitly c. Must not be used implicitly d. Must not be used Methods that you reference with individual objects are _____________. a. private b. public c. static d. nonstatic Variables that are shared by every instantiation of a class are _____________. a. Class variables b. Private variables c. Public variables d. Illegal The keyword final used with a variable declaration indicates _____________. a. The end of the program b. A static field c. A symbolic constant d. That no more variables will be declared in the program Java classes are stored in a folder or _____________. a. Packet b. Bundle c. Package d. Gaggle Dice are used in many games. One die can be thrown to randomly show a value from 1 through 6. Design a Die class that can hold an integer data field for a value (from 1 to 6). Include a constructor... The operator that combines two conditions into a single Boolean value that is true only when both of the conditions are true is ____________. a. $$ b. && c. || d. !! Which of the following displays Error when a student ID is less than 1000 or more than 9999? a. if(stuId < 1000) if(stuId > 9999) System.out.println("Error"); b. if(stuId < 1000 && stuId > 9999)... Which of the following cannot be the argument tested in a switch statement? a. int b. char c. double d. String In each case, determine the problem and fix the program. After you correct the errors, save each file using the same filename preceded with Fix. For example, save DebugFive1.java as... You created a class called RandomGuess. In this game, players guess a number, the application generates a random number, and players determine whether they were correct. Now that you can make... 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... What does the following statement output? for(b = 1; b > 3; ++b) System.out.print(b + " "); a. 1 1 1 b. 1 2 3 c. 1 2 3 4 d. Nothing What does the following statement output? for(f = 1, g = 4; f < g; ++f, g) System.out.print(f + " " + g + " "); a. 1 4 2 5 3 6 4 7 b. 1 4 2 3 3 2 c. 1 4 2 3 d. Nothing For how many integers does the following statement reserve room? int[] value = new int[34]; a. 0 b. 33 c. 34 d. 35 Which of the following can be used as an array subscript? a. char b. String c. double d. int You created a Rock Paper Scissors game. In the game, a player entered a number to represent one of the three choices. Make the following improvements to the game: Allow the user to enter a string... If you declare an integer array as follows, what is the value of num[2]? int[] num = {101, 202, 303, 404, 505, 606}; a. 101 b. 202 c. 303 d. Impossible to tell Unicode value \u0000 is also known as ____________. a. Nil b. Null c. Nada d. Void You created a Secret Phrase game similar to Hangman, in which the user guesses letters in a partially hidden phrase in an attempt to determine the complete phrase. Modify the program so that: The... You created a class named Purchase. Each Purchase contains an invoice number, amount of sale, amount of sales tax, and several methods. Now, write a program that declares an array of five Purchase... If a class named Student contains a method setID() that takes an int argument, and you write an application in which you create an array of 20 Student objects named scholar, which of the following... A parallel array is one that ____________. a. Holds values that correspond to those in another array b. Holds an even number of values c. Is placed adjacent to another array in code d. Is placed... Using a bubble sort involves comparing each array element with ____________. a. The corresponding element in a parallel array b. The adjacent element c. The arithmetic average d. The lowest element... When array elements are objects, you usually want to sort based on a particular ____________ of the object. a. Method b. Field c. Name d. Type The following defines a ____________ array: int[][] nums = { {1, 2}, {3, 4}, {5, 6} }; a. One-dimensional b. Two-dimensional c. Three-dimensional d. Six-dimensional In the following array, what is the value of code[2][1]? char[][] code = { {'A ', 'D ', 'M '}, {'P ', 'R ', 'S '}, {'U ', 'V ', 'Z '} }; a. 'P' b. 'R' c. 'U' d. 'V' In the following array, what is the value of fees[1].length? double[][] fees = { {3.00, 3.50, 4.00, 5.00}, {6.35, 7.35, 8.35, 9.00} }; a. 2 b. 4 c. 8 d. None of the above You place ____________ after the data type in the parameter list of a method that receives a two-dimensional array. a. A pair of empty brackets b. Two pairs of empty brackets c. A pair of brackets... An advantage to using an enumerated data type is ____________. a. Errors are reduced because only a limited set of values can be used with the type b. Time is saved because programs with enumerated... You improved a Rock Paper Scissors game played between a user and the computer. Add an enumeration that holds three values that represent ROCK, PAPER, and SCISSORS, and use it for all comparisons in... In each case, determine the problem and fix the program. After you correct the errors, save each file using the same filename preceded with Fix. For example, DebugTen1.java will become... In each case, determine the problem and fix the program. After you correct the errors, save each file using the samefilename preceded with Fix. For example, DebugEleven1.java will become... All Java Exceptions are ____________. a. Errors b. Omissions c. Throwables d. RunTimeExceptions In object-oriented terminology, you ____________ a procedure that might not Complete correctly. A. Handle B. Catch C. Try D. Encapsulate A method that detects an error condition or exception ____________ an Exception. A. Throws B. Catches C. Handles D. Encapsulates The segment of code that handles or takes appropriate action following an exception is a ____________ block. a. try b. catch c. throws d. handles You ____________ within a try block. A. Must place only a single statement B. Can place any number of statements C. Must place at least two statements D. Must place a catch block When a try block does not generate an exception and you have included Multiple catch blocks, ____________. A. No catch blocks execute B. Only the first one executes C. Only the first matching one... The catch block that begins catch(Exception e) can catch Exceptions of type ____________. a. IOException b. ArithmeticException c. Both of the above d. None of the above The code within a finally block executes when the try block ____________. A. Identifies one or more exceptions B. Does not identify any exceptions C. Either a or b D. Neither a nor b An advantage to using a trycatch block is that exceptional events are ____________. A. Eliminated B. Reduced C. Integrated with regular events D. Isolated from regular events A method can ____________. A. Check for errors but not handle them B. Handle errors but not check for them C. Either of the above D. Neither of the above You can get a list of the methods through which an Exception has traveled by using the ____________ method. a. printStackTrace() b. callStack() c. getPath() d. getMessage() Which of the following is least important to know if you want to be able to use a method to its full potential? A. The number of statements within the method B. The type of arguments the method... Which of the following statements is true? a. Volatile storage lasts only a few seconds. b. Volatile storage is lost when a computer loses power. c. Computer disks are volatile storage devices. d.... Which of the following statements creates a Path named p to a FileStream named f? a. Path p = new Path("C:\\Java\\MyFile.txt"); b. Path p = f("C:\\Java\\MyFile.txt"); c. Path p =... Which of the following statements always returns the same value as Files.exists(file)? a. file.checkAccess() b. file.checkAccess(EXISTS) c. file.checkAccess(READ, WRITE) d.... When records are accessed one after the other in the order in which they were Stored, their file is being used as a ____________ access file. A. Random B. Binary C. Chronological D. Sequential Which of the following is true of streams? a. Streams are channels through which bytes flow. b. Streams always flow in two directions. c. Only one stream can be open in a program at a time. d. All of... You cannot delete a path ____________. A. Under any circumstances B. If it represents a directory C. If it represents a directory that is not empty D. If it represents more than five levels The data hierarchy occurs in the following order from the smallest to largest Piece of data: ____________. A. Character, record, field, file B. Character, file, record, field C. Character, field,... If you fail to close an output file, ____________. A. There are usually no serious consequences B. You might lose access to the written data C. Java will close it for you automatically D. Two of the... inputstream is ____________. A. A child of outputstream B. An abstract class C. Used for screen output as opposed to file output D. All of the above are true. Javas print() and println() methods are defined in the ____________ class. a. BufferedOutputStream b. System c. PrintStream d. Print The newoutputstream() method ____________. A. Is defined in the files class B. Creates a file if it does not already exist C. Opens a file for writing D. All of the above are true. Which of the following does the same thing as the BufferedWriter class newLine() method? a. System.getProperty("line.separator") b. Path.getProperty("line.separator") c. System.out.println() d.... Which of the following systems is most likely to use batch processing? A. An airline reservation system B. An email application C. A point-of-sale credit checking system D. A payroll system Which of the following cannot be specified in any version of the jtextfield constructor? A. The initial text in the field B. Requiring that the value entered be nonnumeric C. The number of columns in... A single array element of a primitive type is passed to a method by ____________. a. Value b. Reference c. Address d. Osmosis When you pass an array to a method, the method receives ____________. a. A copy of the array b. A copy of the first element in the array c. The address of the array d. Nothing Fxml is ____________. A. A low-level declarative language b. An xml-based markup language c. Not as easy to use as swing to create the ui d. Dependent on explicit commands that must be performed in a... Which of the following statements is not true? a. A JavaFX application can be run by using a Java launcher, such as java -jar MyApp.jar, or by double-clicking the JAR file. b. A JavaFX application... Which of the following statements is not true? a. The term stage refers to an entire window. b. The Stage includes the title bar. c. The Scene contains the Stage. d. The Stage includes minimize,... Scene builder ____________. A. Must be downloaded from google play B. Allows for the design layout to be built visually C. Is provided as a built-in class to java D. Must run inside a java IDE Which of the following statements is true? a. Scene Builder uses WYSIWYG. b. Scene Builder does not provide a preview of the UI. c. Scene Builder requires separate layouts for each platform you are... When are you not required to run the Make Controller command? a. You delete a widget from the Content panel in Scene Builder. b. You update an fx:id value for a widget in Scene Builder. c. You add a... Which of the following statements is true? a. The Library panel does not allow for a search of a particular widget control. b. The Library panel simply lists all the available widgets available. c.... Which of the following statements is not true? a. It is possible for a widget to not be visible in the Content panel. b. The Hierarchy section displays a tree view representation of your layout. c.... Which of the following statements is not true? a. A style sheet can be used on any level of a layout. b. Children widgets inherit the CSS rules set on a parent control. c. You can open a CSS file... Which of the following statements is not true? a. Animation in JavaFX must be run either sequentially or in parallel. b. Timeline animation updates property values along a progression of time. c.... Which of the following statements is true about all JavaFX applications? a. All JavaFX must use CSS for styling. b. All JavaFX applications must call the launch() method. c. Every JavaFX calls the... The init() method is used for ____________. A. Pausing a javafx application B. Extending the application class C. Constructing a specified instance of the application class D. Performing... Which of the following statements is not true? Javafx ____________. A. Is event driven, similar to swing B. Uses the keyword new to instantiate a class object C. Uses event handlers similar to swing... Which of the following statements is not true? Scene builder ____________. A. Allows for live editing B. Preview requires a code recompile C. Can run as a standalone application D. Is not appropriate... Scene builder ____________. A. Generates css files B. Requires you to choose a default javafx css style C. Does not allow you to customize the style in your application by changing a Widgets... The css analyzer menu ____________. A. Is visible by default B. Displays style properties rules by default C. Cannot show both api and fx theme defaults D. Allows you to understand how css rules... Prove the following identities algebraically and by means of truth tables: (a) (b) (c) (d) (e) (f) (A+B)(A+B) = 0 A+AB = A+ B
Showing 2500 - 2600 of 5000