A washer (flat ring) is cut out of a circular sheet of metal. A program is needed to calculate the surface area of the resulting washer. The image shows the completed washer in grey.

The required formulae are:
area of outer circle=πR2 \text{area of outer circle} = \pi R^2 area of outer circle=πR2 area of inner circle=πr2 \text{area of inner circle} = \pi r^2 area of inner circle=πr2 surface area of washer=area of outer circle−area of inner circle \text{surface area of washer} = \text{area of outer circle} - \text{area of inner circle} surface area of washer=area of outer circle−area of inner circleThe table shows accurate test results for two sets of inputs.
| Input | Output | |
|---|---|---|
| Outer radius (RRR) | Inner radius (rrr) | |
| 6 | 8 | Invalid input |
| 10 | 4 | 263.8937829015426 |
The program has these requirements:
Below is the content of the file Q03.py:
import math
outer_radius = int(input("Enter outer radius: "))
inner_radius = int(input("Enter inner radius: "))
# Calculate area
area_outer = math.pi * (outer_radius ** 2)
area_inner = math.pi * (inner_radius ** 2)
print(area_outer - area_inner)
Amend the code to meet the requirements of validating the dimensions and outputting the correct result or "Invalid input".
Do not change the functionality of the given lines of code.
Do not add any additional functionality.
Save your amended code file as Q03FINISHED.py
Practise Edexcel GCSE Computer Science Input/output with exam-style questions for GCSE Computer Science. 29 questions covering Accepting and responding to user input, Reading and writing CSV text files, Implementing validation, and Implementing authentication, matched to the Edexcel GCSE Computer Science (1CP2) specification and written in Paper 1 and Paper 2 style. Every question includes a full worked solution and mark scheme, so you can see where marks are awarded rather than just whether you got the answer right.