

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A laboratory exercise in pair programming, a technique used in extreme programming where two developers work together at a single workstation to solve development problems. Background information on pair programming, its benefits, and the expectations for the lab. Participants are required to write code to determine the number of days between two dates using java and eclipse, while switching roles between driver and navigator. The document concludes with a question for students to write a testimonial about their experience with pair programming.
Typology: Lab Reports
1 / 3
This page cannot be seen from the preview
Don't miss anything!


th
Name : ___________________________________________________ Student Number : ___________________________________________________ Laboratory Time : ___________________________________________________ Objectives
th Instructions for the Laboratory Put your answers to Questions 1, 2, and 3 in a file called Lab3.doc or Lab3.pdf , and turn it in via Checkmate under IN4MATX111 , assignment Lab3. This is due by the end of the day. You won't turn in your Java source or compiled code. Section I: Preparation Question 1. Have you used Pair Programming before? If so, was it a positive or negative experience? Question 2. What are your expectations for this lab? Do you expect to like or dislike pair programming? What problems or benefits do you expect to encounter? Section 2: Observations Step 1. Find a partner. Log on to one of your accounts. Step 2. Complete the programming problem stated below. Use Eclipse to write and run your Java program. Two files have been provided for you on the course web page. The first, DateDiff.java, contains a skeleton program to get you started. The other is DateTester.class, which will test whether your solution is complete. Be sure to switch between ādriverā and ānavigatorā roles during the lab. In your code, use meaningful names for identifiers and add appropriate comments. Given two dates, where m1, d1, and y1 is the month, day, and year of the first date, and m2, d2, and y2 is the month, day, and year of the second day, determine the number of days (inclusive) between the two dates. Remember to account for leap years. A year is a leap year if: The year is divisible by 4 but not divisible by 100, OR the year is divisible by 400. For example, 1984 and 2000 are leap years, but 1900 is not. You may assume that the input is a valid date, and that the year will be between 1 and 9999 inclusive. You may assume the second date will not come before the first date. Examples: new DateDiff().difference(1,1,2002,1,2,2003) - > 367 days new DateDiff().difference(1,1,2002,1,1,2003) - > 366 days new DateDiff().difference(2,1,2004,3,1,2004) - > 30 days Step 3. When your program passes all the tests in DateTester, show your solution to your TA.