AdapterHomework - go through the returned array and print...

Info icon This preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Adapter Homework This homework is based on the Adapter in-class exercise we did on Feb. 11, 2010. You will extend the in-class exercise to work not only with Document but also with MyData hierarchy which are described below. MyData classes are provided in MyData.zip. Your Test program has to ask user whether to work with Document or MyData objects. Then ask user how many objects to create for the chosen type and the values to initialize objects. If user chose to work with MyData objects, your program ask user to choose from MyPositiveInteger , MyNegativeInteger or MyDouble objects. You need to implement your own adapter for MyData . After your
Image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: (), go through the returned array and print out the object type and value in each array element. Use hierarchy’s toString () which is implemented to return a String containing the object type and value. For example, ac is an instance of ArrayCopier , resturnedArray = ac.copyArray (). Assume that Object ae = returnedArray [i], use System.out.println(ae) to call () method in each MyData object. If you need to know what are the criteria used for isValid (), getLow () tells you the lower bound and getHigh () tells you the higher bound. Due Date: February 18, 2010...
View Full Document

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern