A program is needed to monitor pressure readings in a chemical reactor. The program must meet the following requirements:
'Hazardous pressure' if the input is outside the permitted range. You can assume only numeric inputs will be entered' is a multiple of 50', if the pressure is divisible by 50' is not a multiple of 50', if the pressure is not divisible by 50.Here is the current, buggy version of the Python code:
pressure = input("Enter pressure (kPa): ")
if pressure < 100 and pressure > 800:
print("Hazardous pressure")
if pressure % 50 == 0:
print(pressure + " is a multiple of 50")
else:
print(pressure + " is not a multiple of 50")
Amend the code to:
print statements so that the input pressure is correctly concatenated or formatted in the output text.Do not add any additional functionality or validation.
51 exam-style questions on Edexcel GCSE Computer Science Develop code, covering Decomposition and abstraction to solve problems, Read, write, analyse and refine programs, Converting algorithms into programs, Techniques for readable, maintainable code, Identifying and correcting program errors, and Evaluating program fitness and efficiency. Each one has a worked solution and a mark scheme showing where the marks go.