// // // CS201 Practice Lab Midterm Exam // // import java.util.Scanner; public class P { public static void main (String[] args) { Scanner scan = new Scanner(System.in); MyClassXXX myObject = new MyClassXXX(); // Replace XXX with your assigned number int age1, age2, age3, n1, n2, oldest; //** The method displayHeading displays your name, BlazerID, CS-201 and your //** row number and seat number. The course name is passed as a parameter. ** 1 point myObject.displayHeading("CS-201"); //** Method oldest(age1,age2,age3) returns the age of the oldest person. //** For example: oldest(30,60,50) returns 60, oldest(30,30,30) returns 30 ** 4 points System.out.print("Enter the first age: "); age1 = scan.nextInt(); System.out.print("Enter the second age: "); age2 = scan.nextInt(); System.out.print("Enter the third age: "); age3 = scan.nextInt(); oldest = myObject.oldest(age1,age2,age3); System.out.println("\nThe oldest person is " + oldest + " years old\n"); //** Method oddNumbers(n1, n2) displays the odd numbers //** from integers n1 to n2 (inclusive) //** The odd numbers are displayed one per line. //** Examples: oddNumbers(1,5) displays: 1 oddNumbers(10,18) displays 11 //** 3 13 //** 5 15 //** ** 5 points 17 System.out.print("\n\nEnter the first integer: "); n1 = scan.nextInt(); System.out.print("\n\nEnter the second integer: "); n2 = scan.nextInt(); myObject.oddNumbers(n1,n2); System.out.println(); } }