CS 1301 – Spring 2016 Lab 9 Working with Methods – Chapter 6 Use JGrasp to develop a complete program for each exercise to include a main method and the specified method(s) in the problem statement. Notice that the main method is used to test the specified method(s). Exercise 1: Design and implement a Java program for programming exercise 6.2, page 234 (name it SumDigits), to computer the sum of digits in an integer number. Follow the instructions in the problem statement. Design the main method of your program such that it allows the user to re-run the program with different inputs (i.e., use a loop structure). Document your code and organize the outputs properly using escape characters. Exercise 2: Design and implement a Java program for programming exercise 6.6, page 235 (name it DisplayPattern), to display a pattern of numbers as specified in the problem statement. Follow the instructions in the problem statement. Design the main method of your program such that it allows the user to re-run the program with different inputs (i.e., use a loop structure). Document your code and organize the outputs properly using escape characters. Exercise 3: Design and implement a Java program for programming exercise 6.12, page 237 (name it DisplayCharacters), to display a sequence of characters with a specified number of characters per line. Follow the instructions in the problem statement. Design the main method of your program as specified in the problem statement. Document your code and organize the outputs properly using escape characters and formatting objects when applicable. Exercise 4: Design and implement a Java program for programming exercise 6.23, page 238 (name it Occurrences), to find the number of occurrences of a letter in a given string. Follow the instructions in the problem statement. Design the main method of your program such that it allows the user to re-run the program with different input strings (i.e., use a loop structure). Document your code and organize the outputs properly using escape characters. Submission: 1. Save all programs. 2. Check with your instructor for submission instructions. Page 1 of 1