Top Selling Computer science Questions

Define a variation on StringLinkedListSelfContained from Listing 12.7 that stores objects of type Employee, rather than objects of type String. Write a program that uses this linked-list class to... An element can be inserted at the beginning, middle, or end of an array list. Which of the three insertion points is the most computationally expensive, and why? Which is the most expensive location... Define ordinal, enumeration, and subrange types. Analyze and write a comparison of using C++ pointers and Java reference variables to refer to fixed heap- dynamic variables. Use safety and convenience as the primary considerations in the comparison. Describe three specific programming situations that require a posttest loop. Suppose you want to write a method that prints a heading on a new output page, along with a page number that is 1 in the first activation and that increases by 1 with each subsequent activation. Can... Write a JavaFX application that uses a text field to get the name of a file, reads the file byte by byte, and displays the bytes as characters. (Exercise 15 describes how to convert a byte value to a... Based on the log file described in Programming Project 10 write a program to detect cheating. This could occur if: A racer misses a sensor, which is a sign that the racer may have taken a shortcut. A... How can the parent version of an inherited method that is overridden in a subclass be called in that subclass in C#? Modify the class LapTimer, as described in Exercise 13 of Chapter 9, as follows: Add an attribute for a file stream to which we can write the times Add a constructor LapTimer(n, person, fileName) for... Complete and fully test the class Person that Exercise 10 describes. Include the following additional methods: getNamereturns the name of the person as a string. getAgereturns the age of the person.... The following program contains 7 mistakes! What are they? What output is produced for each of the following calls? a. IfElseMystery1(3, 20); b. IfElseMystery1(4, 5); c. IfElseMystery1(5, 5); d.... A URL is a type of _________. a. Web page b. URI c. Link d. Network Modify your program from the previous exercise to draw the figure by a method called drawFigure . The method should accept three parameters: the Graphics g of the DrawingPanel on which to draw, and a... How do you use the test() method of the RegExp object to check a string against a regular expression? What string property returns the number of characters in a string? How would the results of the following two statements differ? What type of error occurs when the interpreter fails to recognize code? a. Debugging b. Syntax c. Run-time d. Logic Which API provides access to data from a devices gyroscope and accelerometer? a. Geolocation API b. Battery Status API c. Device Orientation API d. WebRTC API What number is displayed by this program? Set Number1 = 4 Set Number1 = Number1 + 1 Set Number2 = 3 Set Number2 = Number1 * Number2 Write Number2 Write a program that reads a file containing data about the changing popularity of various baby names over time and displays the data about a particular name. Each line of the file stores a name... Write a class called Date that represents a date consisting of a year, month, and day. A Date object should have the following methods: public Date(int year, int month, int day) Constructs a new Date... Add a transfer method to the BankAccount class from the previous exercises. Your method should move money from the current bank account to another account. The method accepts two parameters: a second... Write a class named Dodecagon whose objects represent regular dodecagons (12-sided polygons). Your class should implement the Shape interface defined in this chapter. A Dodecagon object is defined by... The term defensive programming refers to which of the following (select all that apply): a. Ensuring that input data are in the proper range b. Ensuring that a division by 0 does not take place c.... If X = 1 and Y = 2 determine whether each of the following expressions is true or false. (a) T F X >= X OR Y >= X (b) T F X > X AND Y > X (c) T F X > Y OR X > 0 AND Y < 0 (d) T F NOT(NOT(X == 0) AND... The number N factorial, denoted by N!, is defined to be the product of the first N positive integers: N! = 1 2 . . . N For example: 5! = 1 2 3 4 5 = 120 7! = 1 2 3 4 5 6 7 = 5,040 Find... The Sierpinski carpet is a fractal that is defined as follows: The construction of the Sierpinski carpet begins with a square. The square is cut into nine congruent subsquares in a 3-by-3 grid, with... Write a method called reverse that accepts a map from strings to strings as a parameter and returns a new map that is the reverse of the original. The reverse of a map is a new map that uses the... Give the output of the loop in Exercise 19. Data from Exercise 19 Declare K As Integer For (K = 3; K Write a program that solves the classic stable marriage problem. This problem deals with a group of men and a group of women. The program tries to pair them up so as to generate as many stable... To which complexity class does the following algorithm belong? public static void mystery2 (int [] list) { for (int i = 0; i < list.length / 2; i++) { int j = list.length 1 i; int temp = list[i];... To which complexity class does the following algorithm belong? public static void mystery4 (List list) { for (int i = 0; i < list.size () 1; i += 2) { %3D String first list.get (i); !! list.set (i,... What is the output of the code corresponding to the following pseudocode? Declare I, J As Integer For (I = 1; I What is the output of the code corresponding to the following pseudocode? Declare HelloCount As Integer Set HelloCount = 1 Repeat Repeat Write "Hello" Until HelloCount >= 1 Set HelloCount =... The factorial of a positive integer N, denoted by N!, is defined by the following: N! = 1 2 . . . N (Note: 0! = 1 ) Using subprograms and functions, create a recursive program to compute N!. The... Consider the following C program: What is the value of x after the assignment statement in main, assuming a. Operands are evaluated left to right. b. Operands are evaluated right to left. int fun... Redo Programming Challenge 6 but use a binary search. Bonus: Add pseudocode to check how many iterations must be made for each number entered by the user, and, if you also complete Programming... Create a Visual Basic Windows application. Use the following names for the solution and project, respectively: Warren Solution and Warren Project. Save the application in the VB2015\Chap01 folder. a.... Create a Visual Basic Windows application. Use the following names for the solution and project, respectively: Valley Solution and Valley Project. Save the application in the VB2015\Chap01 folder.... In this exercise, you learn about the Format menus Align, Make Same Size, and Center in Form options. a. Open the VB2015\Chap01\Format Solution\Format Solution (Format Solution.sln) file. If... Open the Debug Solution (Debug Solution.sln) file contained in the VB2015\Chap06\ Debug Solution-B15 folder. Open the Code Editor window and review the existing code. Start and then test the... The Internet contains a vast amount of code snippets that you can use in your Visual Basic applications. And in many cases, you can use the snippet without fully understanding each line of its code.... In this exercise, you will create a splash screen that has a transparent background. a. Open the VB2015\Chap01\Transparency Solution\Transparency Solution (Transparency Solution.sln) file. If... In this exercise, you modify one of the Projected Sales applications from this lesson. Use Windows to make a copy of the Sales Solution-For Next folder. Rename the copy Sales Solution-Do While. Open... In this exercise, you modify one of the Concert Tickets applications from this lesson. Use Windows to make a copy of the Concert Solution-Sub folder. Rename the copy Modified Concert Solution-Sub.... In this exercise, you will continue creating the Jordan Sports Store application from Lesson As Exercise 2. Create a Visual Basic Windows application. Use the following names for the solution and... In this exercise, you complete the Jordan Sports Store application from Exercise 2 in both Lesson A and Lesson B. Open the VB2015\Chap02\Jordan Solution\Jordan Solution (Jordan Solution.sln) file. a.... In this exercise, you modify the Favorites application from this lesson. Use Windows to make a copy of the Favorites Solution folder. Rename the copy Modified Favorites Solution. Open the Favorites... In this exercise, you complete the Cranston Berries application from Exercise 3 in both Lesson A and Lesson B. Open the VB2015\Chap02\Cranston Solution\Cranston Solution (Cranston Solution.sln) file.... Modify the HeapIntPriorityQueue class written in this chapter to make it configurable in ways similar to Javas PriorityQueue class. Make it possible for the heap to be a min-heap or max-heap. (If you... K & L Clothiers wants you to create an application that prints a customers sales receipt. A sample receipt is shown in Figure 3-49. Use the following names for the solution and project, respectively:... Create an application that displays a circles area and circumference, given its radius. Use the following names for the solution and project, respectively: Circle Solution and Circle Project. Save... Write a method called descending that accepts an array of integers and rearranges the integers in the array to be in descending order using a PriorityQueue as a helper. For example, if the array... In this exercise, you experiment with procedure-level and class-level variables. Open the VB2015\Chap03\Scope Solution\Scope Solution (Scope Solution.sln) file. The application allows the user to... Explain why a class might provide a set method and a get method for an instance variable. Factorials are used frequently in probability problems. The factorial of a positive integer n (written n! and pronounced n factorial) is equal to the product of the positive integers from 1 to n.... Write a line of code that performs each of the following tasks: a) Specify that class PieceWorker inherits from class Employee. b) Call superclass Employees toString method from subclass PieceWorkers... In this exercise, you modify the Net Income or Loss application from Lesson A. Use Windows to make a copy of the Net Solution folder. Rename the copy Net Solution- Print. Open the Net Solution (Net... Create an application, using the following names for the solution and project, respectively: Dahlia Solution and Dahlia Project. Save the application in the VB2015\ Chap04 folder. Create the... Patti Garcia owns two cars, referred to as Car 1 and Car 2. She wants to drive one of the cars to her vacation destination, but shes not sure which one (if any) would cost her the least amount in... Discuss three proper ways in which you can assign superclass and subclass references to variables of superclass and subclass types. In this exercise, you modify the wedding reception application from Exercise 9. The modified application will display the number of rectangular tables needed to seat the bridal party as well as the... Create an application, using the following names for the solution and project, respectively: Jerome Solution and Jerome Project. Save the application in the VB2015\ Chap04 folder. Create the... What value is contained in the integer variable size after the following statements are executed? Show the contents of a queue after the following operations are performed. Assume the queue is initially empty. enqueue(45); enqueue(12); enqueue(28); dequeue(); dequeue(); enqueue(69); enqueue(27);... In this exercise, you modify the Brazilian Tea application from Exercise 2. Use Windows to make a copy of the Tea Solution folder. Rename the copy Modified Tea Solution. Open the Tea Solution (Tea... Create a Visual Basic Windows application. Use the following names for the solution and project, respectively: Concert Solution and Concert Project. Save the application in the VB2015\Chap05 folder.... In this exercise, you modify the Treeline Resort application from this lesson. Use Windows to make a copy of the Treeline Solution folder. Rename the copy Modified Treeline Solution. Open the... Create an application, using the following names for the solution and project, respectively: Marshall Solution and Marshall Project. Save the application in the VB2015\ Chap05 folder. Create the... Write a program that prompts the user to enter an integer between 0 and 15 and displays its corresponding hex number. For an incorrect input number, display invalid input. Here are some sample runs:... This exercise will show you how to generate and display random numbers containing decimal places. Open the Random Double Solution (Random Double Solution.sln) file contained in the... In this exercise, you modify the Carillo application from Exercise 13. Use Windows to make a copy of the Carillo Solution folder. Rename the copy Modified Carillo Solution. Open the Carillo Solution... In this exercise, you modify the application from Exercise 2. Use Windows to make a copy of the Zip Solution folder. Rename the copy Modified Zip Solution. Open the Zip Solution (Zip Solution.sln)... Write a program that displays all the numbers from 100 to 200 (10 per line) that are divisible by 5 or 6, but not both. Numbers are separated by exactly one space. Modify Solution 2 shown earlier in Figure 6-4. The solution should now keep track of the number of times Sahirahs laser beam missed the spider. After saying You are safe now. The spider is dead.,... In this exercise, you create an application that displays the capital of the state whose name is selected in a combo box. Create an application, using the following names for the solution and... In this exercise, you learn how to specify that one or more arguments are optional in a Call statement. Open the VB2015\Chap07\Optional Solution\Optional Solution (Optional Solution.sln) file. a.... Write a program that moves the ball in a pane. You should define a pane class for displaying the ball and provide the methods for moving the ball left, right, up, and down, as shown in Figure 15.26c.... In this exercise, you modify the Savings Account application from Exercise 13. Use Windows to make a copy of the Savings Solution-Function folder. Rename the copy Savings Solution-Sub. Also change... Create an application, using the following names for the solution and project, respectively: Cable Direct Solution and Cable Direct Project. Save the application in the VB2015\Chap07 folder. Create... In this exercise, you modify the Donut Shoppe application from Exercise 7. Use Windows to make a copy of the Donut Solution folder. Rename the copy Modified Donut Solution. Open the Donut Solution... The implementations of the methods contains(E e), get(int index), indexOf(E e), lastIndexOf(E e), and set(int index, E e) are omitted in the MyLinkedList class. Implement these methods. Define a new... Visual Basic provides the Mid statement for replacing a specified number of characters in a string with another string. The statements syntax is Mid(targetString, start [, count]) =... Write a method called depthSum that returns the sum of the values stored in a binary tree of integers weighted by the depth of each value. The method should return the value at the root, plus 2 times... Define a new class named BSTWithBFT that extends BST with the following method: /** Display the nodes in a breadth-first traversal */ public void breadthFirstTraversal() Use... Write a method called removeLeaves that removes the leaves from a tree. A leaf is a node that has empty left and right subtrees. If your method is called on an empty tree, the method does not change... Write a method called matches that returns a count of the number of nodes in one tree that match nodes in another tree. A match is defined as a pair of nodes that are in the same position in the two... Explain the difference between using a computer program and programming a computer. Suppose we have a hash set that uses the standard mod hash function shown in the chapter and uses linear probing for collision resolution. The starting hash table length is 5, and the table chooses... Write a method called kthSmallest that accepts a PriorityQueue of integers k and an integer as parameters and returns the kth-smallest integer from the priority queue. For example, if the queue... Fill in the blanks in each of the following statements: a) Computers process data under the control of sets of instructions called __________. b) The key logical units of the computer are the , , ,,... Fill in the blanks in each of the following: a. Each class declaration that begins with keyword must be stored in a file that has exactly the same name as the class and ends with the .java filename... What does the following program print? public class Mystery2 { public static void main(String[] args) { int count = 1; while (count Based on the dangling-else discussion in Exercise 4.27, state the output for each of the following code segments when x is 9 and y is 11 and when x is 11 and y is 9. We eliminated the indentation... a) Sum the odd integers between 1 and 99, using a for statement. Assume that the integer variables sum and count have been declared. b) Calculate the value of 2.5 raised to the power of 3, using the... Write a program that prompts the user for a radius and then prints The area and circumference of a circle with that radius The volume and surface area of a sphere with that radius Based on the dangling-else discussion in Exercise 4.27, modify the following code to produce the output shown. Use proper indentation techniques. You must not make any additional changes other than... Fill in the blanks in each of the following statements: a. A method is invoked with a(n) . b. A variable known only within the method in which its declared is called a(n) . c. The __________... Fill in the blanks in each of the following statements: a. A(n) imports all static members of a class. b. String class static method is similar to method System.out.printf, but re- turns a formatted...
Showing 4700 - 4800 of 5000