How would this question be solved using R?

Standards for automated filling of bulk coffee bean bags require that the mean fill amount should be 10 kg and the s.d. of fill amounts should be no more than 0.02 kg. A random sample of 40 bags was weighed and their weights are given in the file:

http://www.utdallas.edu/~ammann/stat3355scripts/Coffee1.txt

a) Use this data to determine if the mean fill amount differs from 10 at the 5% level of significance. Are the assumptions for this test reasonable?

b) What is the probability this test would show a difference if the mean fill amount is 10.1, assuming that the s.d. is no more than 0.03.

c) What sample size would be required to estimate the mean fill amount to within 0.01 kg with 99% confidence assuming that the s.d. is no more than 0.03.

d) Construct a 95% confidence interval for the s.d. of fill amounts.

"Get 15% discount on your first 3 orders with us"
Use the following coupon
FIRST15

Order Now