An environmental scientist is collecting soil samples from a research site. They need to collect a total target mass of soil. Several individual samples will be gathered and weighed one by one, with each sample having a different mass.
Write a Python program that asks the scientist for the target mass of soil required, and then repeatedly asks for the mass of each collected sample until the target mass is met or exceeded.
The program should:
Target reached exactly.Excess is followed by the absolute difference (as a positive number) showing by how much the collected mass exceeded the target.You should use indentation as appropriate, meaningful variable name(s), and Python syntax in your answer.
298 exam-style questions on AQA GCSE Computer Science Programming concepts. Each one has a worked solution and a mark scheme showing where the marks go.