Question: 1 ) Write a program that allows an unlimited number of positive integers to be entered ( one line at a time ) . Program

1) Write a program that allows an unlimited number of positive integers to be entered (one line at a time). Program 1 should ask the user to enter the integers with 0(zero) used as the sentinel value (to end the program). If the entry is not a number, not an integer, or is not positive, the program should display a message about the entry not being a positive integer and the user should be prompted for input again without aborting the program.
Be sure to follow the Program Submission Guidelines document and to use only concepts that we've covered in class so far (including the .isdigit() method above). Do not include min(), max(), user defined functions, lists, etc. or you will receive a zero for the assignment.
Ex: Here is an example of the input and output (the input below is italicized for clarification only -- not to be incorporated into the program)
Enter a positive integer, 0 to stop: 4
Enter a positive integer, 0 to stop: 10
Enter a positive integer, 0 to stop: p
That is not a positive integer
Enter a positive integer, 0 to stop: -2
That is not a positive integer
Enter a positive integer, 0 to stop: 4.2
That is not a positive integer
Enter a positive integer, 0 to stop: 0

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!