Homework 1 -- Warmup CSPP 51036 due Oct 15th at 11:59pm. Submission instructions -Crate a project in eclipse with one driver [a .java file with a main method] for each problem. See video entitled submitProjects2012 for instructions on how to name your project, tar it, and submit it. Be sure to read chapters 1-3 in Horstmann. 1. ReverseEcho.java 2. Summation.java 3. CharCount.java 4. UpperCase.java 5. Adder.java 6. Reorder.java ------------------- 1. ReverseEcho.java: (10 points) Write an application that reverses the order of words in a string. You do not have to preserve multiple white-spaces between words. Example: >> Please input a sentence: You type: Hello my name is Adam >> Adam is name my Hello ------------------- 2. Summation.java: (10 points) Write an application that sums all values from some user-specified min inclusive to some user-specified max inclusive. Example: >> What is your min value? You type: 2 >> What is your max value? You type: 5 >>The sum is: 14 Error Handling: Must elegantly handle the following situations: - maxval is < minval - non-integer input ------------------- 3. CharCount.java: (20 points) Write a rogram that counts all occurences of a user-specified character within a file. Example: >>Please type the full path to you file You type: c:\dev\myFile.txt [myFile.txt contains "This is my sentence and I'm sticking to it."] >>What letter are you searching for? You type: i >>6 occurences of either 'I' or 'i' found. Error Handling: single character is not the input ------------------- 4. Uppercase.java: (20 points) Write a program that converts to uppercase the first character following any period in a file. Example: >> What is the path to your file? You type: c:\dev\mydoc.txt [mydoc.txt contains: the big. red fox jumped. over the lazy. dog.] >> the big. Red fox jumped. Over the lazy. Dog. Error Handling: Can assume input is valid ------------------- 5. Adder.java: (20 points) Write a program that accepts the following commands: The program must run a continuous loop and not shut down after each operation -- that is, continously asks for input unless "exit" is typed. Allow user to input two operands seperated by one operator. Allow +, -, *, /, %. Example: >> What is your operation? You type: 4 + 5 >> 4 + 5 is 9 ; What is your operation? You type: 4 - 3 >> 4 - 3 is 1 ; What is your operation? You type: 17 % 4 >> 17 % 4 is 1 ; What is your operation? You type: exit >>Thank you. Handle gracefully as many incorrect inputs as you can. For example: you type: 3 $ 6 error: No such operator '$' you type: 3 + 2 + 1 error: must supply only two operands you type: a + 2 error: symbol 'a' not a valid integer ------------------- 6. Reorder.java: (20 points) Write a program that reorders an integer array nValues according to a vector of indices nOrders. Example: >>What is your array and reorder sequence You type: 0 4 -1 1000 & 3 0 1 2 >>Your array is now {1000, 0, 4, -1}