Question: (b) You are required to develop a simple program that simulates percent clay content of soil samples. There are five soils to test. Each soil

 (b) You are required to develop a simple program that simulates

(b) You are required to develop a simple program that simulates percent clay content of soil samples. There are five soils to test. Each soil has three (3) replications coded as R1, R2 and R3. A soil passes the test if its clay content is greater or equal to 50 percent otherwise it fails. Define the following functions to be used in your program: (i) def simclay(rep, lowest, highest): Takes integer arguments: rep, low, and high. Returns a list of length rep of randomly generated numbers representing simulated percent clay content in the range low and high (5 marks) (11) def simaverageclay( replist): replist is a list of numbers. Function returns the average of numbers in the list. (3 marks) (iii) def remark( desiredicontent, averageClay): returns True if averageClay is greater or equal to desired Content content for a given soil sample. Otherwise False (3 marks) (iv) def main() : the mainline of the simulation program. Uses the functions declared above to perform the simulation. Prints simulation results to the console The desired print out to console and to file should be in the format below: Name Average Pass/ Fail Test Score R1 R2 R3 50 6040 50 S1 etc Pass (6 marks)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!