m14: graded discussion: input validation loop for ages 1515 unread replies.1515 replies. the purpose of this discussion is to write a loop for input validation. instructions please modify the attached age program so that it uses a loop for input validation. currently, the program allows any number to be input for an age, which is problematic as you can see from this sample output:

Respuesta :

Using the knowledge in computational language in python it is possible to write a code that  input validation loop for ages 1515 unread replies and 1515 replies.

Writtinng the code:

 int nrOfVersions;

       int firstBadVersion;

       while (true) {

           try

           {

               BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));

                       

               System.out.println("How many versions are there? ");

               nrOfVersions = Integer.parseInt(bufferedReader.readLine());

               System.out.println("Which is the first bad version? ");

               firstBadVersion = Integer.parseInt(bufferedReader.readLine());

               

               bufferedReader.close();

               

               break;

           } catch (IOException | NumberFormatException e)

           {

               System.out.println("Retry, puto");

           }

       }

See more about JAVA at brainly.com/question/18502436

#SPJ1

Ver imagen lhmarianateixeira

Otras preguntas