Answered step by step
Verified Expert Solution
Question
1 Approved Answer
in Java please TESTER CLASS package labo1; A Tester class for the TelephoneList Converter author TMR Oversion May 2017 public class TelephoneListConverter Tester public static
in Java please
TESTER CLASS package labo1; A Tester class for the TelephoneList Converter author TMR Oversion May 2017 public class TelephoneListConverter Tester public static void main(String[] args) //Create test data Stringl mixed Numbers = *777-HOME", "777-home", "777-SAVE", *777-save", "1-800-TALK-LAM", "1-880-talk-law", "123-4567", "1234567", "1283XX&&", "ABC DEF GHHH", "IJK-LMNOPQR", "STU-WWX-YZZZ", "abc def ghhh", "ijk-Inn-oper", "stu-VWX-yzzz" String[] expectedAnswers = { "777-4663", "777.4663", "777-7283", "777-7283", "1-800-8255-529", "1-800-8255-529", "123-4567 *12354567","12SSSSSS", "222533354444""455-566-6777" "788-899-9999". "222$333$4444","455-566-6777", "788-899-9999" 7/Create the converter object TelephoneList Converter tlc = new TelephoneListConverter (mixedNumbers); //Get the mapped list String[] pureTelNumList = tle.getPureTelNunList(); //Print the table System.out.println("Table of Test Results: " InInput Value VlExpected Result Computed Result ): for (int index = 0; index 'A' As thischar s= 'C') return 2 : if (thischar 'D' as thischar = 'G' && thischar = 'P's thischar c= '5') return '7': if (thischar E 'T' && thischar = '' && thischar ALL PROGRAMSCIS-CPS-CSC>Eclipse At first it will ask you for a "workspace - and it will give you a default option. I suggest that you all have a "thumb"-drive (also called flash-drive, or pen-drive) and create a folder called "workspace" in it, and use it as the workspace for the whole of this semester. You may also create your workspace on your "P:" drive (filecity) if you wish - Create a folder called "205 workspace" under P: . Once you have created the workspace, and selected it, Eclipse will appear to re-start (you may have to wait a bit), but once you see the new "default screen, you have to click "Workbench on the top right to get to a place where you can do the next steps 1. First create a project Project is a collection of many packages. A package is a collection of classes and maybe) other projects me. Enter: File/New Project Select "Java Project" - It will ask for a project 205 This is your project name for this class (We will have just one Project and many packages) If applicable (ie, if Eclipse "throws" a screen at you). click on the "Open Perspective button on that screen to get to the point where you can create a Java package and class(es) 2. Create a package: A package is a collection of classes and maybe) other projects. Right click on the sic label in the Package Explorer" tab on the left of your Eclipse screen, then select 'New', then package Creating new Package - It will ask for package name. Enter: numconvert We will create a stack package which will contain various implementations of the data Sirku: Stack. 3. Now create a new Java class called Number Converter: First click on the numeonvert package in the Package Explorer" tab. Right click on numrenent (package symbol (hox) and chose new/class- In the dialog that appears, type Number Converter for the class name (By default it will helic package nunconvert: public class Number Converter ( Copy Paste the code from here follows NumberConverter: Converts numbers from decinal to binary, octal Nauthor (TUR) * version (2017) public class NumberConverter Converts a single hex (or octal) to decimal public int convertToInt(char hexDigit) // An array of hex digits, both upper and lower Case for A-F char) hexDigits = ('e','1', '2', '3', '4', '5', '6', '7', '8', '9'. e! " ) 1/Corresponding decimal values int) decValues = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 10, 11, 12, 13, 14, 15); // Search through the hexbigits array to find the hex digit // When fai=ubd, return the corresponding decinal value from // decvalues array for (int k e; k 15) return ; //empty string if in 15) return ; //empty string if in 'A' As thischar s= 'C') return 2 : if (thischar 'D' as thischar = 'G' && thischar = 'P's thischar c= '5') return '7': if (thischar E 'T' && thischar = '' && thischar ALL PROGRAMSCIS-CPS-CSC>Eclipse At first it will ask you for a "workspace - and it will give you a default option. I suggest that you all have a "thumb"-drive (also called flash-drive, or pen-drive) and create a folder called "workspace" in it, and use it as the workspace for the whole of this semester. You may also create your workspace on your "P:" drive (filecity) if you wish - Create a folder called "205 workspace" under P: . Once you have created the workspace, and selected it, Eclipse will appear to re-start (you may have to wait a bit), but once you see the new "default screen, you have to click "Workbench on the top right to get to a place where you can do the next steps 1. First create a project Project is a collection of many packages. A package is a collection of classes and maybe) other projects me. Enter: File/New Project Select "Java Project" - It will ask for a project 205 This is your project name for this class (We will have just one Project and many packages) If applicable (ie, if Eclipse "throws" a screen at you). click on the "Open Perspective button on that screen to get to the point where you can create a Java package and class(es) 2. Create a package: A package is a collection of classes and maybe) other projects. Right click on the sic label in the Package Explorer" tab on the left of your Eclipse screen, then select 'New', then package Creating new Package - It will ask for package name. Enter: numconvert We will create a stack package which will contain various implementations of the data Sirku: Stack. 3. Now create a new Java class called Number Converter: First click on the numeonvert package in the Package Explorer" tab. Right click on numrenent (package symbol (hox) and chose new/class- In the dialog that appears, type Number Converter for the class name (By default it will helic package nunconvert: public class Number Converter ( Copy Paste the code from here follows NumberConverter: Converts numbers from decinal to binary, octal Nauthor (TUR) * version (2017) public class NumberConverter Converts a single hex (or octal) to decimal public int convertToInt(char hexDigit) // An array of hex digits, both upper and lower Case for A-F char) hexDigits = ('e','1', '2', '3', '4', '5', '6', '7', '8', '9'. e! " ) 1/Corresponding decimal values int) decValues = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 10, 11, 12, 13, 14, 15); // Search through the hexbigits array to find the hex digit // When fai=ubd, return the corresponding decinal value from // decvalues array for (int k e; k 15) return ; //empty string if in 15) return ; //empty string if inStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started