E Consider the following code: public void test (int x) { int y; if (x %...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
E Consider the following code: public void test (int x) { int y; if (x % 2 == 0) y = 3; else if (x>9) y = 5; else y = 1; System.out.println("y"+y); } Which of the following test data sets would test each possible output for the method? a.) 7,8,9 d.) 8,9,11 b.) 7, 9, 10 e.) 8, 11, 13 c.) 7, 9, 11 E Consider the following code: public void test (int x) { int y; if (x % 2 == 0) y = 3; else if (x>9) y = 5; else y = 1; System.out.println("y"+y); } Which of the following test data sets would test each possible output for the method? a.) 7,8,9 d.) 8,9,11 b.) 7, 9, 10 e.) 8, 11, 13 c.) 7, 9, 11
Expert Answer:
Answer rating: 100% (QA)
Answer There is mainly 3 conditions for generating the output 1if x 2 0 y3 2else if x 9 y5 3 else y1 ... View the full answer
Related Book For
Data Structures and Algorithms in Java
ISBN: 978-1118771334
6th edition
Authors: Michael T. Goodrich, Roberto Tamassia, Michael H. Goldwasser
Posted Date:
Students also viewed these electrical engineering questions
-
Consider the following code fragment, taken from some package:
-
Consider the following code: For (i = 0; i < 20; i++) For (j = 0; j < 10; j++) A[i] = a [i] * j a. Give one example of the spatial locality in the code. b. Give one example of the temporal locality...
-
Consider the following code fragment: if K > 10 L: = K + 1 else L: = K - 1; A straightforward translation of this statement into SPARC assembler could take the following form: The code contains a nop...
-
In a task assignment situation, in how many different ways can five jobs be assigned to five machines if each job must be assigned to each machine and each machine must be assigned one job? Multiple...
-
1. To increase the supply of money, the Fed should_______ bonds. 2. Increasing reserve requirements _______ the supply of money. 3. Banks trade reserves with one another in the _______ market. 4....
-
Abby Roland is the bookkeeper for Cheng Company. Abby has been trying to determine the correct balance sheet for Cheng Company. Chengs balance sheet is shown below. Instructions Prepare a correct...
-
A simple random sample of 75 people are given a new drug that is designed to relieve pain. After taking this drug for a month, they switch to a standard drug. The question of interest is whether the...
-
A simple pendulum has a mass of 0.250 kg and a length of 1.00 m. It is displaced through an angle of 15.0 and then released. What are (a) the maximum speed, (b) The maximum angular acceleration, and...
-
Juice 20 15 13. 530 10 Refer to the following graph: 57 10 20 40 Snacks Assuming that this consumer has $80 to spend on Juice and Snacks, identify three price quantity combinations that lie on the...
-
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 solenoid 60 cm long and of radius 4.0 cm has 3 layers of windings of 300 turns each. A 2.0 cm long wire of mass 2.5 g lies inside the solenoid (near its centre) normal to its axis; both the wire...
-
Visiit the Bureau of labor statistics website www.bls.gov/news.release/cpi.toc.htm. You will be using Consumer Price Index Summary II and the Table 1 Consumer Price Index for all Urban Consumer...
-
Eagle Industries' bonds have a 10-year maturity and a 8.00% coupon paid semiannually. They sell at their $1,000 par value, and are not callable. What s the effective annual rate (EFF %) for these...
-
Labor force growth is the great unknown in forecasting unemployment rates because people's reactions are very difficult to gauge. For example, during recessions, will people not bother looking for a...
-
Find the after-tax return to a corporation that buys a share of preferred stock at $35, sells it at year-end at $35, and receives a $4 year- end dividend. The firm is in the 30% tax bracket (Round...
-
Fortunately, the iron didn't hit a dolphin, but it quickly sinks to the bottom. Unfortunately, the meteorite has many sharp edges and she is worried the dolphins, curious creatures that they are,...
-
An ad for Hydroxycut, a dietary supplement sold as a weight loss aid, depicts a handsome man with an open shirt with ripped abdominal muscles who claims that he "was shocked at how fast Hydroxycut...
-
A bar of length = 1 has one fixed and one free end and stiffness function c(x) = 1 - x. Find the displacement when subjected to a unit force. Pay careful attention to the boundary condition at the...
-
Extend a solution to the previous problem so that users are allowed to update the prices for their buy or sell orders that have yet to be processed.
-
Suppose that we create an array A of GameEntry objects, which has an integer scores field, and we clone A and store the result in an array B. If we then immediately set A[4].score equal to 550, what...
-
Can edge list E be omitted from the adjacency list representation while still achieving the time bounds given in Table 14.3? Why or why not? Method numVertices(), numEdges() vertices() edges()...
-
Fill in the blank X ~ N(1, 2) = _______
-
The trial balance columns of the worksheet for Briscoe Company at June 30, 2008, are as follows. Other data: 1. A physical count reveals \($300\) of supplies on hand. 2. \($100\) of the unearned...
-
Emil Skoda Company had the following adjusted trial balance. Instructions (a) Prepare closing entries at June 30, 2008. (b) Prepare a post-closing trial balance. EMIL SKODA COMPANY Adjusted Trial...
Study smarter with the SolutionInn App