Day-05-Arrays

# Day-05-Arrays - CSE116 CSE504 Introduction to Computer...

• Notes
• 25

This preview shows pages 1–10. Sign up to view the full content.

CSE116 / CSE504 Introduction to Computer Science II Dr. Carl Alphonce 343 Davis Hall [email protected] Office hours: Thursday 12:00 PM – 2:00 PM Friday 8:30 AM – 10:30 AM OR request appointment via e-mail

This preview has intentionally blurred sections. Sign up to view the full version.

PROFESSIONALISM Turn off and put away electronics: cell phones pagers laptops tablets etc. © Dr. Carl Alphonce
ANNOUNCEMENTS Sign up for Piazza (up to 90% registration!) piazza.com/buffalo/spring2016/cse116 Recitation Attendance for full recitation time is expected ACM meeting Tonight @ 7:00 PM in Davis Hall, 2 nd floor atrium

This preview has intentionally blurred sections. Sign up to view the full version.

Today Writing tests Running JUnit MultiSet Coming up Arrays Defining the MultiSet ROADMAP
MultiSet<E>, a.k.a. Bag<E> HashSet<E> MultiSet<E> ArrayList<E> Allows duplicates No Yes Yes Exposes order No No Yes Different Collection<E> classes

This preview has intentionally blurred sections. Sign up to view the full version.

Exercise Define a test to verify that a MultiSet<E> can contain duplicate items.
channel 1

This preview has intentionally blurred sections. Sign up to view the full version.

What is a correct order for these statements to make a JUnit test? 1) assertTrue("...",expected == actual); 2) int expected = 2; 3) ms.add(s); ms.add(s); int actual = ms.size(); 4) MultiSet<String> ms = new MultiSet<String>(); 5) String s = "River"; A. 4, 2, 5, 3, 1 B. 5, 3, 2, 4, 1 C. 2, 1, 4, 3, 5 D. 5, 4, 3, 1, 2
What is a correct order for these statements to make a JUnit test?

This preview has intentionally blurred sections. Sign up to view the full version.

This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### What students are saying

• 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.

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

• 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.

Dana University of Pennsylvania ‘17, Course Hero Intern

• 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.

Jill Tulane University ‘16, Course Hero Intern