$29
Outcomes:
• Write programs that obtain user input
• Write programs that compute mathematical results
• Write programs that work with Strings
• Format and comment source code that adheres to a given set of formatting guidelines
• Use a zip compression tool to combine multiple files
Requirements: You will write three separate Java programs
1. (5 points) Read and understand the pseudocode of problem R2.20 from the end of chapter 2 in your textbook. In a Java class named StringSwapper, write a java program that reads an input string, 2 indexes in the string and displays a new string with the characters at these 2 positions swapped.
2. (5 points) In a Java class named BookstoreOrder, solve problem P2.22 from the end of chapter 2 in your textbook.
3. (5 points) In a Java class named ExtractDollarsAndCents, solve problem P2.25 from the end of chapter 2 in your textbook.
4. (5 points) Include a set of test cases for StringSwapper program. Include a list of the test cases at the top with the comments and the expected outputs. (Read Section 3.6 about Test Cases). You should also indicate the test case(s) that did not work for your program along with the wrong output it printed. Note that this part of the assignment is worth 5 points. You can get full credit for this, even if your StringSwapper class does not always produce the correct answer.
5. Follow these steps to submit your work:
a. Create an empty folder named program4.
b. Put copies of your three source code files (.java) in the program4 folder. Do not put any other files in that folder. There should be exactly 3 .java files.
c. Compress the folder to create a zip file. Be sure it ends with .zip.
d. Submit only the zip file to the Canvas website.
Note: If you submit your work and decide to modify one of your programs, you need to resubmit a new zip file containing all three source code files (even if you only modified one of them). Do not rename your source code files. Do not rename the zip file. Canvas may add a number to the name of your zip file. That is fine. But you should keep all filenames the same.