Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

R3.11 Give a set of four test cases (not including g5) for the algorithm of Exer

ID: 3599174 • Letter: R

Question

R3.11 Give a set of four test cases (not including g5) for the algorithm of Exercise R3.10 that covers all branches. . R3.12 In a scheduling program, we want to check whether two appointments overlap. For simplicity, appointments start at a full hour, and we use military time (with hours 0- 24). The following pseudocode describes an algorithm that determines whether the appointment with start time start1 and end time end1 overlaps with the appointment with start time start2 and end time end2. f start1>start2 s = start! Else s = start2 fend1end2 e end1 e end2 The appointments overlap The appointments don't overlap. Else Else Trace this algorithm with an appointment from 10-12 and one from 11-13, then with an appointment from 10-11 and one from 12-13.

Explanation / Answer

R3.11: For this question R3.10 question needs to be known. Chegg experts won't get the questions sequentially. So please post this question with R3.10 and ask to solve the answer for this part only.

R3.12:

Implemented the code and tested with both the cases given.

code:

========

public class Appointment {

static int start1, end1, start2, end2, s,e;

public static void main(String[] args) {

start1 = 10;

end1 =12;

start2 = 11;

end2 = 13;

if(start1>start2) {

s = start1;

}

else {

s = start2;

}

if(end1>end2) {

e = end1;

}

else {

e = end2;

}

if (s<e) {

System.out.println("The appointments overlap");

}

else{

System.out.println("The appointments don't overlap");

}

}

}