Click here to Skip to main content
15,891,184 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Microbiologist estimating the number of bacteria in a sample that contains bacteria that do not grow well on solid media may
use a statistical technique called the nu most probable number (MPN) method. Each of five tubes of nutrient medium receives
10 ml of the sample. A second set of five tubes receives 1 ml of sample per tube, and in each of the a third set of five tubes,
only 0.1 ml of sample is placed. Each tube in which bacterial growth is observed is recorded as a positive, and the numbers
for the three groups are combined to create a triplet such as 5-2-1, which means that five tubes receiving 10 ml of sample
showed bacterial growth, only two tubes in the 1-ml group showed growth,and only one of the 0.1-ml group was positive. A
microbiologist would use this combination-of-positives triplet as an index in the table like Table 1 to determine that the most
probable number of bacteria per 100 ml of the sample is 70, and 95% of the samples yielding this triplet between 30 and 210
bacteria per 100 ml. This information is stored in a file, mpm.txt, that has the same structure as Table 1.
(a) Define a type, MPNInfo, that represents each record in the file containing information on bacterial concentrations for
Most Probable Number. Each of these records is made of a string combination-of-positives as described above, an
integer representing the MPN Index/100 ml, the lower number of bacteria per 100 ml, and upper number of bacteria per
100 ml. [4]
Table 1: Table of Bacterial Concentrations for Most Probable Number Method
95% Confidence Limits
Combination of
Positives MPN Index/100 ml Lower Upper
4-2-0 22 9 56
4-2-1 26 12 65
4-3-0 27 12 67
4-3-1 33 33 77
4-4-0 34 16 80
5-0-0 23 9 86
5-0-1 30 10 110
5-0-2 40 20 140
(b) Define a function LoadMpnTable that uses a variable of type MPNInfo to load the MPN table from a stored file, mpn.txt,
into four parallel arrays:
– an array of strings combOfPositives
– three integer arrays - mpn, lower and upper
Your function must return the actual array size (number of records read from the file)
(c) Define a function Search that takes as arguments: the actual size of arrays, the arrays read in (b):
– an array of strings combOfPositives
– three integer arrays - mpn, lower and upper
and a combination-of-positives triplet and finds its index in the array combOfPositives, and produces the following:
– if the target is found, this index is used to generate a message. For example, using information in Table 1, if the
triplet given is 5-2-1, the following message is produced:
For 5-2-1, MPN = 70, 95% of samples contain between
30 and 210 bacteria / ml
– if the target is not found in the array, the following message is produced:
The combination 5-2-1 does not exist
(d) Write a driver program that tests the functions written above

What I have tried:

i dont understand yet how to do the code, please assist.
Posted
Updated 17-Jun-21 10:43am
Comments
jeron1 17-Jun-21 15:43pm    
can you solve this on paper?
Richard MacCutchan 17-Jun-21 16:23pm    
Here is a suggestion: stop finding more and more complex problems which you do not understand. Focus on one of the simpler ones and work on that until you have a working solution. Repeatedly posting them here for other people to solve is just a waste of your, and our, time.
Greg Utas 17-Jun-21 17:07pm    
10.

While we are more than willing to help those that are stuck, that doesn't mean that we are here to do it all for you! We can't do all the work, you are either getting paid for this, or it's part of your grades and it wouldn't be at all fair for us to do it all for you.

So we need you to do the work, and we will help you when you get stuck. That doesn't mean we will give you a step by step solution you can hand in!
Start by explaining where you are at the moment, and what the next step in the process is. Then tell us what you have tried to get that next step working, and what happened when you did.

If you are having problems getting started at all, then this may help: How to Write Code to Solve a Problem, A Beginner's Guide[^]
 
Share this answer
 
Quote:
i dont understand yet how to do the code

you need to learn how to analyze/organize requirements to prepare solving the problem.
It is something out of scope of this little forum, but:
- Learn one or more analyze methods, E.W. Djikstra/N. Wirth Stepwize Refinement/top-Down method is a good start.
Structured Programming.pdf[^]
https://en.wikipedia.org/wiki/Top-down_and_bottom-up_design[^]
https://en.wikipedia.org/wiki/Structured_programming[^]
https://en.wikipedia.org/wiki/Edsger_W._Dijkstra[^]
https://www.cs.utexas.edu/users/EWD/ewd03xx/EWD316.PDF[^]
Program Development by Stepwise Refinement[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900