CSCI-1320 Homework 08: Dog Years Revisited Again

Instructor: Todd Dole

Purpose Statement

This is an opportunity to use a while loop to validate input. Although we demonstrated something very similar in the class session it would be good to attempt to solve this "from scratch." As always, take time to "play around" with while loops apart from this assignment so that you can become comfortable with their syntax and semantics.

Instructions

For this assignment you will modify the “dog years” program you wrote for homework #5. Rename the class DogYearsIII and save it as DogYearsIII.java.

The program for this assignment will obtain a dog's age in human years and calculate the “dog years” equivalent as before. The output will include the dog's age in dog years along with appropriate commentary.

When obtaining the dog's age from the user you should require that the age in human years be in the range 0 through 30. As long as the user enters values outside that range you should require re-entry. Once a valid age has been obtained, then perform the calculations and produce the output. Upload your solution (your DogYearsIII.java source code file) to the assignment in Canvas.