You are right that using a fraction such as 22/7 dynamically inside your code can give you more felxibility and more accurate results. You are completely missing the point, however, which is that 22/7 is a very bad value for Pi. 22/7 = 3.14285... so you see it goes off at 4th decimal already. So if 22/7 was the value you wanted to use, you would be correct, but as you want to be using an accurate value of Pi, any use of 22/7 will screw you over.
This is simply wrong. 22/7 does not equate 3.14159, for some reason you seem to have replaced it with a 6 decimal approximation of Pi.
This calculation is correct, and again it gives you a very bad answer, because you want to be using a more accurate approx of Pi than 22/7.