{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

hw10 - Integer.parseInt(String to parse the two strings...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
HW #10 1. Copy the InClass21 folder from the usual locations. 2. Open the project using BlueJ. 3. Edit the source file for InClass21 . 4. 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
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 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

{[ snackBarMessage ]}