Unformatted text preview: 1. Copy the InClass21 folder from the usual locations. 2. Open the project using BlueJ. 3. Edit the source file for InClass21 . 4. Exercise A. Write a void method addUpAFile() that will ask the user for a file name. Use a try-catch statement to attempt to open the file, and if successful, computes the number of integers in the file and their sum. You may use the existing code for previousExample() as help. 5. HW#10. Write a void method addUpTwoNumbers() that will ask the user to input two integers. Use a try-catch statement to make sure that they are indeed two integers. Read the input in as two strings and use Integer.parseInt(String) to parse the two strings into integers. If they are not integers, output some message to that effect. You may use the existing code for previousExample2() as help. Bonus: Write this method so that it keeps asking the user for input until the user types in legitimate integers....
View Full Document
This lab report was uploaded on 04/08/2008 for the course CSCI 112 taught by Professor Yuen during the Fall '07 term at Lake Forest.
- Fall '07