ION 33252 * Project Explorer Ju JUnit X Finished after 0.111 seconds Runs: 13/13 Failure Trace...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
ION 33252 * Project Explorer Ju JUnit X Finished after 0.111 seconds Runs: 13/13 Failure Trace * Errors: 0 Failures: 0 >deque.Lab08DequeTest [Runner: JUnit 4] (0.040 s) E. 8 QY DequeInterface.ja 94 950 96 97 98 99 100 101 102 103 104 105 106 107 108 1090 110 111 112 1130 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 1290 130 131 1320 133 134 135 136 137 138 139 1400 141 142 1430 144 145 } } DLinkedDeque.jav */ public void testRemoveFrontException() { Exception exception = null; try { } EmptyQueueExcepti } } catch (Exception e) { exception = e; /** * Testing a removeBackException */ public void testremoveBackException() { Exception exception = null; try { deque.removeFront (); fail("removeFront() is not throwing an exceotption when it should"); deque. addToBack ("Hello"); deque. removeFront (); assertTrue ("removeFront () is throwing the wrong type of exceptions", exception instanceof EmptyQueueException); P } catch (Exception e) { exception = e; Lab08DequeTest.ja X /** * Testing a getFornt () */ public void testGetFront () { deque. addToFront ("Kiran"); deque2.removeBack(); fail("removeBack() is not throwing an exception when it should"); BagInterface.jav /** * Testing a getFrontException */ assertTrue ("removeBack() is throwing the wrong type of exceptions", exception instanceof EmptyQueueException); deque. addToFront ("Thapa"); deque. addToFront ("Karan"); assertEquals("Karan", deque.getFront()); public void testGetFrontException() { Exception exception = null; try { ArrayBasedStackT Writable Lab08Deque.java X 61 62 63 64 Smart Insert 65 66 67 68 69 70 71 72 73 74 75 76 770 78 79 80 81 82 83 840 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 1000 101 102 103 104 105 106 107 1080 109 110 111 112 } 1T (1sEmpty()) { } throw new EmptyQueueException(); } T front = getFront (); firstNode = firstNode.getNextNode(); if (firstNode == null) { lastNode = null; else { firstNode.setPreviousNode (null); return front; /** * Remove the item at the rear of the deque. * * @return The item that was removed * @throws EmptyQueueException * */ public T removeBack() { if (isEmpty()) { throw new EmptyQueueException(); } T back = getBack(); lastNode = lastNode.getPreviousNode(); if there is no element at the front if (lastNode == null) { lastNode = null; } else { 121:30: 3220 lastNode.setNextNode (null); } return back; /** * Get the item at the front (the head) of the deque. * deque. * * @return the item at the front of the deque. *@throws EmptyQueueException * */ public T getFront() { if (isEmpty()) { if no element at the front throw new EmptyQueueException(); return firstNode.getData(); o 20 ** ION 33252 * Project Explorer Ju JUnit X Finished after 0.111 seconds Runs: 13/13 Failure Trace * Errors: 0 Failures: 0 >deque.Lab08DequeTest [Runner: JUnit 4] (0.040 s) E. 8 QY DequeInterface.ja 94 950 96 97 98 99 100 101 102 103 104 105 106 107 108 1090 110 111 112 1130 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 1290 130 131 1320 133 134 135 136 137 138 139 1400 141 142 1430 144 145 } } DLinkedDeque.jav */ public void testRemoveFrontException() { Exception exception = null; try { } EmptyQueueExcepti } } catch (Exception e) { exception = e; /** * Testing a removeBackException */ public void testremoveBackException() { Exception exception = null; try { deque.removeFront (); fail("removeFront() is not throwing an exceotption when it should"); deque. addToBack ("Hello"); deque. removeFront (); assertTrue ("removeFront () is throwing the wrong type of exceptions", exception instanceof EmptyQueueException); P } catch (Exception e) { exception = e; Lab08DequeTest.ja X /** * Testing a getFornt () */ public void testGetFront () { deque. addToFront ("Kiran"); deque2.removeBack(); fail("removeBack() is not throwing an exception when it should"); BagInterface.jav /** * Testing a getFrontException */ assertTrue ("removeBack() is throwing the wrong type of exceptions", exception instanceof EmptyQueueException); deque. addToFront ("Thapa"); deque. addToFront ("Karan"); assertEquals("Karan", deque.getFront()); public void testGetFrontException() { Exception exception = null; try { ArrayBasedStackT Writable Lab08Deque.java X 61 62 63 64 Smart Insert 65 66 67 68 69 70 71 72 73 74 75 76 770 78 79 80 81 82 83 840 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 1000 101 102 103 104 105 106 107 1080 109 110 111 112 } 1T (1sEmpty()) { } throw new EmptyQueueException(); } T front = getFront (); firstNode = firstNode.getNextNode(); if (firstNode == null) { lastNode = null; else { firstNode.setPreviousNode (null); return front; /** * Remove the item at the rear of the deque. * * @return The item that was removed * @throws EmptyQueueException * */ public T removeBack() { if (isEmpty()) { throw new EmptyQueueException(); } T back = getBack(); lastNode = lastNode.getPreviousNode(); if there is no element at the front if (lastNode == null) { lastNode = null; } else { 121:30: 3220 lastNode.setNextNode (null); } return back; /** * Get the item at the front (the head) of the deque. * deque. * * @return the item at the front of the deque. *@throws EmptyQueueException * */ public T getFront() { if (isEmpty()) { if no element at the front throw new EmptyQueueException(); return firstNode.getData(); o 20 **
Expert Answer:
Related Book For
Introduction to Operations and Supply Chain Management
ISBN: 978-0132747325
3rd edition
Authors: Cecil B. Bozarth, Robert B. Handfield
Posted Date:
Students also viewed these programming questions
-
Rearrange the following lines of code to read two integers until two different input values are entered. How to use this tool Unused valid = True second = int (input()) while not valid : valid print...
-
A diamond mine has a production function for extracting diamonds, q, defined as 16K 1/6, where Lis labor measured in hours worked, and Kis the number of useful tools used in the mining process. The...
-
Tort cases are so common that it is likely you or someone you know has been involved in a tort case. If so, share what the case was about, what the outcome was, and how you felt about the case and...
-
On January 1, Snipes Construction paid for earth-moving equipment by issuing a $300,000, 3-year note that specified 2% interest to be paid on December 31 of each year. The equipment's retail cash...
-
How would the government policies affect international trade flows? Explain in details.
-
The balance sheet data for Bobs Electronics, Co., November 30, 2010, follow: Requirement 1. The following are three independent assumptions about the business during November. For each assumption,...
-
The Sherill Utility District was recently established. Its balance sheet, after one year, is presented below. Note the following additional information: ¢ The general fund received all of its...
-
(1) Consider the economy of Happy Island that has the following domestic demand and supply equations for coffee beans: Qd 100-5P: Domestic Demand Qs = 5P _ Domestic Supply No trade equilibrium: a....
-
The December 31, 2024, adjusted trial balance for the Blueboy Cheese Corporation is presented below. Required: 1. Prepare an income statement for the year ended December 31, 2024, and a classified...
-
Consider linear search. That is, given integers & and 1, 2,..., n, determine whether a is contained in 1, X2,..., n by comparing x with , 2,..., n one at a time. Is this problem in P? If yes, provide...
-
Refer to the Little Pear Group Salary Packaging Policy to learn about the FBT treatment. Help Erick to compare the two options by completing the below table. No Salary Sacrifice 1. Package Value 2....
-
Harry, a university student, was happy. He had just been able to find a part-time job. The job was not that interesting- working on the factory floor- but at least he was going to make a bit of money...
-
Security Lieutenant (manager) for hospital university will over 50 site in PA, a few in NJ, and soon coming DE. Position put out for Center City Philadelphia. It primarily focuses on but not limited...
-
The admissions director at a local university has noticed a steady decrease in applications to the university. She notices that the decrease began when the university implemented admission standards...
-
A. What is Alpha One's NOPAT? Why does NOPAT differ from the earnings after taxes? B. Estimate the effective before-tax cost of the long-term debt. c. Estimate the effective after-tax cost of the...
-
Alkali and alkaline earth metals react with oxygen to form oxides, peroxides, and superoxides. (a) Indicate the most likely product for each of the Group I and Group II elements. (b) What physical...
-
Express mass density in kg/m3 and weight density in lb/ft3. 1. Find the mass density of a chunk of rock of mass 215 g that displaces a volume of 75.0 cm3 of water. 2. A block of wood is 55.9 in. x...
-
Flynn Industries has outsourced the delivery of its products and now wants to develop a tool to help evaluate its transportation carriers. The table at the bottom of the page shows the rating values...
-
Suppose COGS and merchandise inventory were each cut by 10%. What would be the new pretax prot margin and ROA?
-
Your manager has come to you with the following data, showing actual demand for ve periods and forecast results for two different models. He has asked you to tell him which forecast model is best and...
-
The following experimental data are available for \(\mathrm{CO}_{2}\) gas at \(92^{\circ} \mathrm{C}\) : PR 1 2 3 4 6 8 10 0.856 0.583 0.535 0.620 0.800 0.975 1.160 Find the fugacity of CO2 at 100...
-
What do you mean by extent of reaction? Derive an expression of the relationship between mole fraction of the component and the extent of reaction.
-
Give an informatory note on equilibrium constant of the chemical reaction.
Study smarter with the SolutionInn App