The probability that student pilot passes the written test for a private pilot's license is 0.7. Find the probability that the student will pass the test:
(a) on the third attempt
(b) before the fourth attempt.
Also find the average number of attempts needed to pass the test.