1. Engineering
  2. Computer Science
  3. java code and it should have two classes one where...

Question: java code and it should have two classes one where...

Question details

Description To this point you have developed code and manually tested the results. Hopefully you have been utilizing the code a little, test a little methodology of programming (if not, start!) Although you have not been programming very long, you still may have encountered a scenario much like the following You are presented with a programming problem and begin devising a solution After some thought you begin to program what will be your masterpiece! Some develop has occurred, perhaps even a piece of functionality is complete, but now comes the testing! Does it do what I actually think it will do? Did I code it correctly, or do I have a bug? Perhaps there are multiple bugs?! So what do you do, you run the program manually, giving it various input data values and cross your fingers that things go well. Lets say that they do so you happily proceed on to the next piece of code/functionality. Once again you go to test your code, but now the piece that was working, suddenly isnt! Or perhaps it never was and you just didnt use the same test values in this round of testing as you did the first time If you have not encountered the above, then you probably havent been programming very long or have only working on really small programs, <2000 Lines Of Code (LOC). There are multiple problems occurring in the scenario above, some dealing with development style, some dealing with programming experience, and two big ones dealing with inconsistency of practice and lack of automation! We are quite writing programs to automate a mundane task and what could be more mundane than testing a program manually... Yuck! Lucky for us there is a simple solution, automated testing, which just happens to be the focus of this labProgram Specifications Implement the following methods AND write automated test cases using JUnit to verify the correctness of each. Test cases should be written in the class Lab1Test.java 1. a. public static double add (double a, double b) throws Exception; b. public static int characterCount (char c, String text); i. Counts the occurances of the character c in the text provided c. public static String formatText (String text, int formatType); i. Camel case will be defined as a capital letter following any period, exclamation or question mark AND the first letter of the text. d. public static int add(int a, int b) throws Exception; e. public static float add(float a, float b) throws Exception; f. public static double divide(double a, double b) throws Exception; g. public static int divide(int a, int b) throws Exception; h. public static float divide(float a, float b) throws Exception; i. public static int getTotalComputations() throws Exception; i. Returns the total number of times any/all of the add and divide methods were called. Provided Code The code below is a self-contained class. No additional code needs to be added to this class, it should exist as is! Make sure to submit this along with your code solution. package edu.ben.labs.lab1; public class FormatType f public static final int UPPERCASE; public static final int LOWERCASE 1; public static final int CAMELCASE2; Packaging: Fully qualified class names are listed below: (Note: the bold is the class itself) Lab1 Lab1Test

JAVA CODE and it should have two classes

-One where the code is

-second where the JUNIT Test is see example below

Homeworko.java | DỊ HomeworkOTest.java33 ії in..in packagehomeworks. homeworke; 1 package e 3 public class Homeworke 5 public static void main(Stringll args) f homeworks. homeworke; 3+ import org. junit.Test: public class HomeworkeTest extends TestCase t System.out.print n(Helto wortd) @Test public void test) f String expected:,Hello, world! ; Homeworke.main nulu) String actual systemout.getHistory); assertEquals (expected, actua): 10 12 h 16

Solution by an expert tutor
Blurred Solution
This question has been solved
Subscribe to see this solution