CSC 204 Exam 1 You will need to hand in four files for this exam: terminology.txt Birthday.java Repeats.java Area.java place them on the cs.centenary.edu server in your csc204 directory in a directory named exam1. This exam is due at 4:45 on Thursday, March 13th. You are allowed to use the textbook and your previous programs written for this class. You may not use the internet or the textbook website, except for the Java API found at http://java.sun.com/j2se/1.5.0/docs/api/ You must follow the honor code for this homework. Terminology. Define the following terms and give an example of each: control flow method parameter primitive data type data structure Short Answer When should you use a while loop instead of a for loop? What is the difference between top-down and bottom-up programming? Write these answers in a file called terminology.txt. Also write the honor code in this file. Birthday problem. Suppose that people enter an empty room until a pair of people share a birthday. On average, how many people will have to enter before there is a match? Write a program Birthday.java and run experiments to estimate the value of this quantity. Assume birthdays to be uniform random integers between 0 and 364. Run this program as % java Birthday with the output being your estimate of how many people. Longest consecutive streak. Write a program Repeats.java that reads in a sequence of integers and printsout the integer that appears the most times in-a-row. For example, if the input is 1 2 2 1 5 1 1 7 7 7 7 1 1 then your program should print out the integer 7. This program should use StdIn to process the sequence of integers. Run this program as % java -cp .:stdlib.jar Repeats < numbers.txt with numbers.txt being a text file you create with a list of numbers, and the output being the integer that appears the most times in-a-row. Area of a circle. /****************** * Copy this code into a file called Area.java * Use Java to debug this program, which calculates * the area of a circle when given the radius r. * r should be a double floating point number. The output * of % java Area 4.3 should be * The area of the circle is 27.01769682087222 ******************/ public class Area { public void static main(string[] args) { // Get the radius from the user int r = Double.parseInteger(args[1]); // Calculate the area double area = Math.PI * 2 * r // Print out the area system.println("The area of the circle is + area");