EECS2030: LAB 8 Due: Apr 3th, XXXXXXXXXX:59 pm The purpose of this lab is to practice working with Generics as well as practice comprehending Junit test cases. 1. Setup Please download Lab8.zip that...

1 answer below »
can you solve this please


EECS2030: LAB 8 Due: Apr 3th, 2022- 11:59 pm The purpose of this lab is to practice working with Generics as well as practice comprehending Junit test cases. 1. Setup Please download Lab8.zip that is attached to this description. • Open eclipse. • Click on File and select Import. • Choose Existing Projects into Workspace and click Next. • Click on Select Archive File and then Browse. Find Lab8.zip and click Finish. • Please make sure that you do not already have a project called EECS2030_Lab8, otherwise, eclipse cannot import it for you. You should see two files, one is called Utility.java and one UtilityTester.java. 2. Programming Task For this lab, we are asking you to create a parameterized class called Utility and decide on its methods’ signature. Class Utility is a class that contains 4 methods. The implementation of the methods is given below. The only thing that you need to do is to decide on the correct method signature so that all the test cases are passed. • linearSearch is a method that linearly searches for the given item (i.e. the input parameter) in list. The list is the instance variable of class Utility. You should decide on what is the correct method signature when the implementation looks like below: int position = -1; for (int i = 0; i (); for (T obj: list) this.list.add(obj); return true; } else return false; • removeZero is a method that does not work on the instance variable of this class. It gets a list and removes all the zeros from the list. Here is the implementation of the method: for (int i = 0; i < mylist.size(); i++) { if (myinteger.iszero(mylist.get(i))) { mylist.remove(i); i--; } } in addition to the above methods, you should implement the constructors of the class in a way that does not fail the test cases. a few other classes can be found in utility.java that are used for testing the correctness of your code. these classes are called point, myinteger, naturalnumber, oddnumber and evennumber. for this lab, we do not provide any javadoc on purpose, because the implementation of the methods are given. besides, we don’t want to give any hint on the signature of the methods. 3. submit you only submit one file that is called utility.java via eclass by clicking on the lab link. although you are encouraged to write the javadoc, you do not need to submit the html files. mylist.size();="" i++)="" {="" if="" (myinteger.iszero(mylist.get(i)))="" {="" mylist.remove(i);="" i--;="" }="" }="" in="" addition="" to="" the="" above="" methods,="" you="" should="" implement="" the="" constructors="" of="" the="" class="" in="" a="" way="" that="" does="" not="" fail="" the="" test="" cases.="" a="" few="" other="" classes="" can="" be="" found="" in="" utility.java="" that="" are="" used="" for="" testing="" the="" correctness="" of="" your="" code.="" these="" classes="" are="" called="" point,="" myinteger,="" naturalnumber,="" oddnumber="" and="" evennumber.="" for="" this="" lab,="" we="" do="" not="" provide="" any="" javadoc="" on="" purpose,="" because="" the="" implementation="" of="" the="" methods="" are="" given.="" besides,="" we="" don’t="" want="" to="" give="" any="" hint="" on="" the="" signature="" of="" the="" methods.="" 3.="" submit="" you="" only="" submit="" one="" file="" that="" is="" called="" utility.java="" via="" eclass="" by="" clicking="" on="" the="" lab="" link.="" although="" you="" are="" encouraged="" to="" write="" the="" javadoc,="" you="" do="" not="" need="" to="" submit="" the="" html="">
Answered Same DayMar 31, 2022

Answer To: EECS2030: LAB 8 Due: Apr 3th, XXXXXXXXXX:59 pm The purpose of this lab is to practice working with...

Kshitij answered on Apr 01 2022
93 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here