Top Selling Computer science Questions

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... Mountain Coffee wants a program that allows a clerk to enter the number of pounds of coffee ordered, the price per pound, and whether the customer should be charged a 3.5% sales tax. The program... Draw the hierarchy chart and design the logic for a program for Arnies Appliances. Design a program that prompts the user for a refrigerator model name and the interior height, width, and depth in... A group of statements that executes as a unit is a _____________. a. Block b. Family c. Chunk d. Cohort 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.... 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 a. The Downdog Yoga Studio offers five types of classes, as shown in Table 6-1. Design a program that accepts a number representing a class and then displays the name of the class. Class Number Class... 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... Random access memory is ___________. a. Volatile b. Permanent c. Persistent d. Continual 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++,... 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. Employee records stored in order from highest-paid to lowest-paid have been sorted in _____ order. a. Descending b. Ascending c. Staggered d. Recursive 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 10 numbers and displays them in descending order. Girl Scout Troop 815 has 18 members. Write a program in which the troop leader can enter the number of boxes of cookies sold by each scout, and output the total number of boxes sold and the mean and... Building Block Day Care Center charges varying weekly rates depending on the age of the child and the number of days per week the child attends, as shown in Table 8-5. Develop the logic for a program... 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 Create the logic for a program that computes hotel guest rates at Cornwalls Country Inn. Include two overloaded methods named computeRate(). One version accepts a number of days and calculates the... 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... 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. Create a class named Apartment that includes an apartment number, number of bedrooms, number of baths, and monthly rent. Include two overloaded constructors. The... Complete the following tasks: a. Design a method that calculates the cost of boarding a horse at Delmar Stables. The method accepts a code for the type of boarding, S for self-care, which provides... 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 grammar : stmt assignment subr_call assignment id := expr subr call id ( arg list ) expr primary expr tail expr tail op expr primary id subr_call ( expr ) op + | -... 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? Write an LL(1) grammar with action routines and automatic attribute space management that generates the reverse Polish translation described in Exercise 4.7. Data From Exercise 4.7: Suppose that we... 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... 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 {...... 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... 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 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... 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... Open the VB2015\Chap06\Multiplication Solution (Multiplication Solution.sln) file. Code the application to display a multiplication table similar to the one shown in Figure 6-31. Use the For...Next... 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? 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? 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... 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... What are the five main components of an information system? 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 are the five steps in the software acquisition process? 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... 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... 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 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...
Showing 1700 - 1800 of 5000