Question: Tasks: Follow the directions below to complete your lab assignment For today's lab we will be completing Exercise P9.7 from the book. IMPORTANT!! All of
Tasks: Follow the directions below to complete your lab assignment For today's lab we will be completing Exercise P9.7 from the book. IMPORTANT!! All of your method/class names need to match what is shown in this document. This is the public interface of your class. The classes and methods you need to implement are as follows: Circuit single method getResistance. Note that this is simply an empty circuit with no resistors, and therefore the resistance is always 0 for objects of this class. This is the parent class. Resistor subclass of Circuit. Represents a single resistor. Needs to override the getResistance method from the superclass Circuit. To compute the value of the Resistor object you simply return the resistance value. Serial subclass of Circuit. Contains an ArrayList
Choice 1: You should add multiple circuits to the CircuitDemo.java file to verify that your program works as expected. Take screen-shots or capture the output text and include this in your project folder. Sample output from a working project using the given CircuitDemo.java file is shown below. (Look at the java file on UTC Learn to see the test code that produced this output). Combined resistance: 75.0 Expected: 75.0 Choice 2: BONUS: Use the JUnit unit testing framework to run multiple tests on your circuit. Use class name CircuitTester. The completeness of your testing will determine the number of bonus points you receive. (Also, your tests should pass). Feel free to use google to figure out how to use junit and get it running. (You may also discuss this among yourselves JUST HOW TO GET IT WORKING). Once junit is working, you must think of and implement YOUR OWN tests. Of course, I am available to help you with this as well. (The basic idea is that you will need to import two .jar files (org.junit.Test and org.junit.Assert) into your current project, and then write tests as demonstrated in section 8.7 of the book).
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
