Top Selling Computer science Questions

Your downloadable files for Chapter 2 include DEBUG02-01.txt, DEBUG02-02. txt, and DEBUG02-03.txt. Each file starts with some comments that describe the problem. Comments are lines that begin with... A _____ expression has one of two values, often expressed as true or false. a. Georgian b. Boolean c. Selection d. Caesarian When a loop executes, the structure-controlling condition is ______________. a. Tested exactly once b. Never tested more than once c. Tested either before or after the loop body executes d. tested... In an AND condition, the most efficient technique is to first ask the question that ______________. a. Is most likely to be true b. Is least likely to be true c. That contains the most operands d.... If conditionA is 30 percent likely to be true and conditionB is 10 percent likely to be true, then it is most efficient to test conditionA first ______________. a. In an OR decision b. In an AND... Which of the following is a poorly written, trivial Boolean expression? a. a > b AND b > c b. a = 100 OR b > 200 c. a < b AND c < 100 AND d 5 d. a < 10 AND a > 40 In the following pseudocode, what percentage raise will an employee in Department 8 receive? if department < 5 then raise = SMALL_RAISE else if department < 14 then raise = MEDIUM_RAISE else if... A programmers most important task before planning the logic of a program is to ____________. a. Decide which programming language to use b. Code the problem c. Train the users of the program d.... A program contains a seven-element array that holds the names of the days of the week. At the start of the program, you display the day names using a subscript named dayNum. You display the same... A file named MAINTENANCE06-01.txt is included with your downloadable student files. Assume that this program is a working program in your organization and that it needs modifications as described in... If necessary, create a new project named Introductory20 Project and save it in the Cpp8\Chap14 folder. Also create a new source file named Introductory20.cpp. Create a program that saves prices in a... Design the logic for the game Hangman, in which the user guesses letters in a hidden word. Store the letters of a word in an array of characters. Display a dash for each missing letter. Allow the... A file named MAINTENANCE07-01.txt is included with your downloadable student files. Assume that this program is a working program in your organization and that it needs modifications as described in... In the Game Zone section of Chapter 5, you designed a guessing game in which the application generates a random number and the player tries to guess it. After each guess, you displayed a message... HappyTunes is an application for downloading music files. Each time a file is purchased, a transaction record is created that includes the music genre and price paid. The available genres are... A file named MAINTENANCE08-01.txt is included with your downloadable student files. Assume that this program is a working program in your organization and that it needs modifications as described in... Your downloadable files for Chapter 8 include a file named DEBUG08-04.jpg that contains a flowchart with syntax and/or logical errors. Examine the flowchart, and then find and correct all the bugs. In the Game Zone section of Chapter 6, you designed the logic for a quiz that contains multiple-choice questions about a topic of your choice. (Each question had three answer options.) Now, modify... Your downloadable files for Chapter 9 include a file named DEBUG09-04.jpg that contains a flowchart with syntax and/or logical errors. Examine the flowchart, and then find and correct all the bugs. Your downloadable student files for Chapter 10 include DEBUG10-01.txt, DEBUG10-02.txt, and DEBUG10-03.txt. Each file starts with some comments that describe the problem. Comments are lines that begin... Your downloadable files for Chapter 10 include a file named DEBUG10-04.jpg that contains a class diagram with syntax and/or logical errors. Examine the class diagram, and then find and correct all... A file named MAINTENANCE11-01.txt is included with your downloadable student files. Assume that this program is a working program in your organization and that it needs modifications as described in... Your downloadable files for Chapter 11 include DEBUG11-01.txt, DEBUG11-02.txt, and DEBUG11-03.txt. Each file starts with some comments that describe the problem. Comments are lines that begin with... Your downloadable files for Chapter 11 include a file named DEBUG11-04.jpg that contains a class diagram with syntax and/or logical errors. Examine the class diagram and then find and correct all the... Give a formal definition of an enumerator. Consider it to be a type of two-tape Turing machine that uses its second tape as the printer. Include a definition of the enumerated language. Give context-free grammars that generate the following languages. In all parts, the alphabet is {0,1}. Aa. {w| w contains at least three 1s} b. {w| w starts and ends with the same symbol} c. {w| the... A finite state transducer (FST) is a type of deterministic finite automaton whose output is a string and not just accept or reject . The following are state diagrams of finite state transducers T 1... Show that EQ CFG is co-Turing-recognizable. Create a program that allows the user to enter any number of integers. The program should display the sum of the integers. Use the while statement and a negative number as the sentinel value. If... Write the code to store the number 100 in each element in the balances array from Pencil and Paper Exercise 1. Use two for statements. Code the algorithm shown in Figure 6-41. Use the switch statement to code the multiple-alternative selection structure. If necessary, create a new project named TryThis11 Project, and save it in the... Karlton Learning wants a program that displays the amount of money a company owes for a seminar. The fee per person is based on the number of people the company registers, as shown in Figure 6-42.... In this exercise, you will create a program that displays both the smallest and largest of three integers entered by the user. For example, if the user enters the numbers 3, 5, and 9, the program... In this exercise, you will experiment with the switch statement. a. Follow the instructions for starting C++ and viewing the Advanced20.cpp file, which is contained in either the... The Path class getFileName() method returns . a. The String representation of a Path b. An absolute Path c. The first item in a Paths list of name elements d. The last item in a Paths list of name... How would you write cout < < "Hello, "; cout < < fi rst_name; cout < < "! "; as a single line of code? What kinds of literals are there? What are some good rules for choosing names? What is the difference between a declaration and a definition? What does adding const to a member function do? Yet another solution to the problem of the previous exercise is to make the sorting routine a method of a sorter class. The comparison routine can then be passed into the class as a constructor... Write a Prolog sorting routine that is guaranteed to take O(n log n) time in the worst case. Consider the following fragment of code in C: (a) Assume that each integer variable occupies four bytes. How much total space is required for the variables in this code? (b) Describe an algorithm... Suppose that we want to translate constant expressions into the postfix, or reverse Polish notation of logician Jan ukasiewicz. Postfix notation does not require parentheses. It appears in... To reduce the likelihood of typographic errors, the digits comprising most credit card numbers are designed to satisfy the so-called Luhn formula, standardized by ANSI in the 1960s, and named for IBM... Consider a mid-test loop, here written in C, that looks for blank lines in its input: Show how you might accomplish the same task using a while or do (repeat) loop, if mid-test loops were not... Rubin [Rub87] used the following example (rewritten here in C) to argue in favor of a goto statement: The intent of the code is to find the first all-zero row, if any, of an n n matrix. Do you find... There is a data structure called a drop-out stack that behaves like a stack in every respect except that if the stack size is n, when the n+1 element is pushed, the first element is lost. Implement a... Write a while loop that uses an explicit iterator to accomplish the same thing as Exercise 7.1. Exercise 7.1. Write a for-each loop that prints all elements in a collection of Student objects called... Determine the growth function and order of the following code fragment: for (int count = 0; count < n; count ++) { for (int count2 = 0; count2 < n; count2 = count2 + 2) { System.out.println(count,... Consider the following fragment of code: if (x > 5) { System.out.println("A"); if (x < 10) System.out.println("B"); } else System.out.println("C"); What is displayed if x is a. 4; b. 5; c. 6; d. 9;... Write a program that accepts a string as input, then prints out the vowels in that string and then prints the consonants in that string. >>> splitem("elephant") Vowels: eea Consonants: lphnt What will be printed for this function if you executed each of these: (a) TestMe (1, 2, 3) (b) TestMe (3, 2, 1) (c) TestMe (5, 75, 20) def testMe (p,q, r): if q > 50: print r value = 10 for i in... Write a function to blend two pictures: 25% of one picture blended with 75% of another. Write a function to mirror along the diagonal from (0, 0) to (width, height). Write a function to mirror along the diagonal from (0, height) to (width, 0). One of the four functions below generated this picture. Which one is it? A. B. C. D. def newpic1(inpic): getwidth(inpic) getHeight(inpic) outpic = W = h makeEmptyPicture (w,h) outX = w-1 for inx in... Describe what this function does. Try different numbers as input. def test (num): if num > 0: return num test(num-1) else: return 0 Describe what this function does. Try different numbers as input. def test(num): if num > 0: return test(num-1) * num else: return 0 Describe what this function does. Try different numbers as input. def test(num): if num > 0: return test(num-1) else: return 0 Suppose that you have a variable called line that will take on the values 1, 2, 3, 4, and so on, and a class constant named SIZE that takes one of two values. You are going to formulate expressions... Why do computers use binary numbers? Write a program that draws checkerboards like these shown in Figure 3G.37 onto a DrawingPanel of size 420 300. Drawing Panel Write a program that converts a time from 24-hour notation to 12-hour notation. The following is a sample interaction between the user and the program: Enter time in 24-hour notation: 13:07 That is... Write code to declare an ArrayList holding the first 10 multiples of 2: 0, 2, 4,..., 18. Use a loop to fill the list with the proper elements. Compute the weakest precondition for each of the following assignment statements and postconditions: a. a = 2 * (b - 1) - 1 {a > 0} b. b = (c + 10) / 3 {b > 6} c. a = a + 2 * b - 1 {a > 1} d. x = 2 *... Approximate the runtime of the following code fragment, in terms of n: int sum 0; %3D for (int j 1; j < n; j++) { %3D sum++; if (j % 2 0) { sum++; Design a set of simple test programs to determine the type compatibility rules of a C compiler to which you have access. Write a report of your findings. What is the primary reason why all Java objects have a common ancestor? Explain the advantages and disadvantages of having all values in a language be objects. What are the language design requirements for a language that supports abstract data types? Describe the three ways a client can reference a name from a namespace in C++. Evaluate the following expressions: a. Math.abs(1.6) b. Math.abs(2 + 4) c. Math.pow(6, 2) d. Math.pow(5 / 2, 6) e. Math.ceil(9.1) f. Math.ceil(115.8) g. Math.max(7, 4) h. Math.min(8, 3 + 2) i.... Write a program that draws the image shown in Figure 3G.39 onto a DrawingPanel of size 650 400. The image represents a famous optical illusion called the Cafe Wall, in which a series of straight... Write a method called printSquare that accepts a minimum and maximum integer and prints a square of lines of increasing numbers. The first line should start with the minimum, and each line that... Write a class called RationalNumber that represents a fraction with an integer numerator and denominator. A RationalNumber object should have the following methods: public RationalNumber(int... A(n) ____________ error results from statements that do not properly perform their intended task. Write a program to score users responses to the classic MyersBriggs personality test. Assume that the test has 70 questions that determine a persons personality in four dimensions. Each question has... Figure 12.12 shows only part of the decision tree for the first two levels. How many entries are there at the second level of the full tree? How many are at level 3 of the full tree? empty col l row... Write a method called splitStack that accepts a stack of integers as a parameter and rearranges its elements so that all the negatives appear on the bottom of the stack and all the nonnegatives... Write a method called isConsecutive that accepts a stack of integers as a parameter and that returns true if the stack contains a sequence of consecutive integers starting from the bottom of the... Write a program to compute and display an investments total interest and final value when the user inputs the original amount invested, rate of interest (as a decimal), and number of years invested.... A(n) ____________ function is one that is supplied by the programming language; its code does not appear in the program that uses it. Write a Visual Basic Do clause that processes the loop instructions as long as the value in the intNum variable is less than or equal to the number 100. Use the While keyword. Then rewrite the Do... Write a Visual Basic assignment statement that updates the decTotal accumulator variable by the value stored in the decSales variable. Create a Visual Basic Windows application. Use the following names for the solution and project, respectively: Penguin Solution and Penguin Project. Save the application in the VB2015\Chap01 folder.... Write a Visual Basic assignment statement that subtracts the contents of the decReturns variable from the contents of the decSales accumulator variable. In this exercise, you modify the Chopkins Toys application from Exercise 2. Use Windows to make a copy of the Chopkins Solution folder. Rename the copy Modified Chopkins Solution. Open the Chopkins... Write a method called average that accepts two integer parameters and returns their average as a floating point value. Write a program that prompts the user to enter a hex digit and displays its corresponding binary number in four digits. For example, hex digit 7 is 0111 in binary. Hex digits can be entered either in... Write a program that creates an ArrayList and adds a Loan object, a Date object, a string, and a Circle object to the list, and use a loop to display all the elements in the list by invoking the... In this exercise, you create an application that displays the name of the artist corresponding to the song title selected in a combo box. Create the application, using the following names for the... Write the following generic method using selection sort and a comparator: public static void selectionSort(E[] list, Comparator comparator) Write a test program that prompts the user to enter six... The Donut Shoppe sells four varieties of doughnuts: Glazed ($.75), Sugar ($.75), Chocolate ($.75), and Filled ($.95). It also sells regular coffee ($1.50) and cappuccino ($2.75). The store manager... Write a program that performs Huffman encoding and compression using a binary tree. Huffman coding is an algorithm devised by David A. Huffman of MIT in 1952 for compressing text data to make a file... Write a program that prints a greeting of your choice, perhaps in a language other than English. Which parts of a computer can store program code? Which can store user data? Write a method called countLeftNodes that returns the number of left children in the tree. A left child is a node that appears as the root of the left-hand subtree of another node. For example,... Write a program that prints your name in Morse code, like this: .... .- .-. .-. -.-- Use a separate call to System.out.print for each letter. Consider the following code segment. double purchase = 19.93; double payment = 20.00; double change = payment - purchase; System.out.println(change); The code segment prints the change as...
Showing 3300 - 3400 of 5000