- Testing for Whole Numbers
- 01 Feb 2018 10:06:30 am Permalink
- Last edited by annoyedhumanoid on 01 Feb 2018 10:13:58 am; edited 1 time in total
I'm making a program to find the perimeter of any shape, and it's separated into two sections: polygons, and non-polygons. My polygon section works interestingly, in which it asks the user for the number of sides and then let's you input numbers until the number of entries reaches the number of sides. I have a feature implemented that makes sure one enters a number 3 or greater (because polygons have to have 3 or more sides) but is there a way to make sure one enters a whole number (because you can't have a polygon with 2.8, 4.87, etc. sides)?