Please help answering questions 2, 3, and 4. I have already done number 1.
CIS 043 Midterm Exam I - Programming Problems: (40 points) 1. (10 Points) Write a program SelectWinner.java to pick winners. You have 4 t-shirts and 2 ipads to give away and a pool of 16 students. The students are assigned numbers from 1 to 16. a. Randomly select 4 students to receive the t-shirts. (It is OK to select the same student more than one time) b. Randomly select 2 students to receive the iPads. Make sure to pick two different students. (Make use of loops in your program). Sample output: Winners for T-shirts are: Student number 7 9 12 9 Winners for i-Pads are: Student number 5 12 2. (10 Points) A party planner is organizing a party. Write a program CostEstimate.java that performs the following, • Rental cost is $100. Food cost is as follows: For groups with 1-5 people, cost is $20 per person For groups with 6-10 people, cost is $18 per person For groups with 11-15 people cost is $16 per person For groups with more than 15 people, cost is $15 per person. • Define a method called cost which takes one parameters, the number of people in the party, calculates the per person price (food cost with rental cost), then returns the cost per person. • Call cost method in the program to produce a cost estimate table that shows the party size from 2, 4, up to 20 people. Sample output: Party Size (#people) Cost Estimate Per Person 2 $70.00 4 $45.00 6 $34.67 8 $30.50 10 $28.00 12 $24.33 …. 20 $20.00 3. (10 Points) A person keeps a log of daily spending. Write a program SpendingReport.java that reports the statics of the spending for a week. • Ask user to enter daily spending within the week. (Day 1, Monday, through day 7, Sunday). Save the information in an array. • Calculate the total and the average spending for the week. • Count the total days where spending is higher than the average. • Print out average, total, number of days higher than the average and the day of the week with highest spending. Sample output: Enter spending day 1 ($): 25 Enter spending day 2 ($): 16.5 Enter spending day 3 ($): 23.5 Enter spending day 4 ($): 12 Enter spending day 5 ($): 0 Enter spending day 6 ($): 42 Enter spending day 7 ($): 31 Total spending: $ Average: $21.43/day Number of days above average spending: 4 Highest spending day: Saturday 4. (10 Points) Design a class called Student. This class is used to represent a student with student id, name and total number of units completed in college. Include standard methods (overloaded constructors, gets, sets, toString) and also include a method that determines the student’s class standing based on number of units completed, a student’s standing is a freshman if completed 30 units or under, a sophomore if completed 31 to 60 units, a junior if completed 61-90 units or a senior (90 units or above). Write out an UML diagram for the Student class. (See a sample in Fig 3.12 on Page 87). Then write Student.java to implement the class design. Write StudentTest.java to create a student object with id as 1234567, name as John Smith, number of units completed as 55.0. Print out the student information including the standing. Then ask user to enter the units completed in current semester, the print the updated information. Sample output: Student information : Student ID: 1234567 Student Name: John Smith Total Number of Units Completed: 55.0 Class Standing: Sophomore Enter Current Semester Units: 12.5 Updated Student information: Student Name: John Smith Total Number of Units Completed: 67.5 Class Standing: Junior Put all program code and output into a single .txt file. Submit this file in the Midterm 1 Submission on Canvas.