CSC 211 -- Java Programming I PRACTICE MIDTERM B PRACTICE PROBLEMS Part 1. Write Java programs that will input a single piece of information or two pieces of information, and then output the results of a calculation about that information. a. Input an integer and output whether that number ends in a 7. Hint: Either convert the integer to a string with the method String.valueOf, or use the % operator. b. Input a string and output whether that string begins with a 'T' or a 't'. Consider the case of a zero length string.
c. Input an integer and output whether the integer is a prime number. Hint: If n is the integer, check all integers k from 2 to n - 1 to see if they are factors of n by using If (n % k == 0) Part 2. Write Java programs that will input a list of items terminated by a sentinel. The program then prints output summarizing the list. a. Input a list of positive integers. Output the number of numbers that end in 7. b. Input a list of strings. Output whether any of the strings has a length of 4. c. Input a list of hours worked and hourly wage. Output the total amount paid in wages. d. Input a list of name, gender, and salary. Output the name of the woman that earns the most money. Hint: In addition to keeping track of the largest salary of all the women, you also need to keep trace of the name of the woman with the largest salary.