Question: Question 4 Past Answers Problem 2 : Valid Age Suppose a program is to read in an integer value representing the age of a person.
Question
Past Answers
Problem : Valid Age
Suppose a program is to read in an integer value representing the age of a person. It makes sense that the value should be within a reasonable range, say to both inclusive. If the us enters an invalid input outside this range, the program should ask for the age again.
Write a function checkage to perform this task and also to count how many times the user has entered the input.
Note: user input should be taken through console as keyboard input and the program should output to the standard out ie print
Sample run #:
Enter age:
Your age is
Number of attempts
Sample run #:
Enter age:
Bener age:
Enter sge:
thater of atcentets
Downioad file
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
