![]() Step 6: Copy Over AddFive.java and AddBoth.java From the Previous Lab ![]() ![]() This file will later be submitted along with the rest of the code you write. This file is produced automatically by jGrasp upon compiling and running the tests. While you don't need to edit any code for this step, be sure to save AreaCalculationMethodTest.class in a safe spot. Use the instructions here to open AreaCalculationMethodTest.java as a tests file, then compile and run the tests.Īll the tests have been provided, and assuming you implemented your calculateArea method correctly, they should all pass. Step 5: Download, Open, Compile, and Run the Tests In AreaCalculationMethodTest.javaĭownload the AreaCalculationMethodTest.java file, being sure to put it in the same folder/directory as your AreaCalculationMethod.java file from step 1.ĪreaCalculationMethodTest.java contains a bunch of tests for the calculateArea method you wrote in step 1. You only need to do this once per computer you have jGrasp installed on. You can do this by following the instructions here. If you're using jGrasp, you'll need to configure jGrasp to use JUnit. You will need to define a method in order to get this code compiling, and you may not modify the main method.ĭegreeConversionMethod.java contains more details in the comments.ĭownload the CompoundInterestMethod.java file, and open it in jGrasp (or a text editor of your choice).ĬompoundInterestMethod.java contains more details in the comments.Įnter annual interest rate (double): 0.02Įnter number of times interest is compounded per year (int): 6Ĭompound interest including principal: 75.92099374307139 More details are in the comments of AreaCalculationMethod.java.Įxample output of the program is shown below, with user input shown in bold:ĭownload the DegreeConversionMethod.java file, and open it in jGrasp (or a text editor of your choice). Unlike with previous labs, you may not modify the code in the main method. You'll need to implement the concatenate method, without modifying the main method. Step-by-Step Instructions Step 1: Edit AreaCalculationMethod.javaĭownload the AreaCalculationMethod.java file, and open it in jGrasp (or a text editor of your choice). Use JUnit to write and execute basic tests for methods.Define methods as necessary to make code compile and run.Lab 5: More Methods and an Introduction to Testing with JUnit Lab 5: More Methods and an Introduction to Testing with JUnitĭue Monday, September 18 at 11:59 PM Goals for This Labīy the time you have completed this work, you should be able to:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |