Answer & Explanation:The Botanist from Project 1 was very pleased with your application for recording measurements and displaying the data in histogram from. Because of this, you have decided to make the application more robust so that it can be marketed as a solution for data collection and visualization. Modify your application from Project 1 to incorporate the following features:1. Nested navigation menus2. Support for up to 5 banks of measurement data3. Statistical analysis functions4. Ability to produce both histograms and scatter plotsSince this is intended to be commercial software, it is absolutely critical that the end user cannot crash your application. Download and run the Project_2.exe to view the expected behavior.Phase 1: Nested Navigation MenusYour program should be able to display the following menu choices for the various functions of the
project___20191117203729_2.pdf
project__2_2.docx
project__1_solution_2.docx
Unformatted Attachment Preview
Scanned with CamScanner
Scanned with CamScanner
Scanned with CamScanner
Scanned with CamScanner
Scanned with CamScanner
double data[5][50]={{40.9799, 116.0669,
85.9172,
68.7723,
58.2823,
134.4404,
98.5348, 122.7901, 101.6063,
96.7513, 138.5480, 156.4141,
225.6080,
52.1351,
68.8695, 171.8917, 100.5100,
50.9367, 135.7771,
197.6621, 155.3947, 217.8692, 145.2271, 213.2265, 103.0094,
63.0110,
109.4438, 179.5122,
64.1896, 151.7637,
89.9294, 147.5592,
65.0080,
124.2995,
19.7718,
95.3456, 143.1024, 103.9498, 181.8278,
88.4360,
3.7394,
58.4182, 172.7824, 114.3388, 138.9612, 167.2100,
13.9787,
87.7661,
84.7849,
69.0931},
{74.5375, 125.6304,
78.8468,
116.8234,
59.1139,
80.2257,
56.5132,
97.6082,
72.4638,
94.4041,
100.0447,
77.6504, 106.6752, 149.2786,
95.7392,
79.6464, 107.3942,
81.6782,
46.7879,
94.5649,
79.8498,
71.7135, 118.2936, 135.9020,
64.3232,
83.1027,
55.7705, 100.4132,
9.0623, 109.7034,
86.5670,
87.8499, 116.4033,
71.7600,
76.0060,
41.8850,
30.0918,
58.8934,
88.4264,
63.7637,
39.9941, 112.1806,
58.6374,
79.6614,
79.9755,
72.5169,
91.8973,
72.0796,
30.0797,
49.1307},
{132.1547,
57.1705, 102.6408,
72.9314,
61.2720,
68.9429,
99.9167, 128.6833, 114.1941, 173.2060,
107.7307,
44.1230, 120.4867, 123.5686, 135.8268, 144.9913, 183.9042,
92.6092, 133.0404, 119.3412,
90.9868, 226.8154, 107.1191,
49.5236,
208.5050, 136.2773,
64.0480, 151.0175, 183.4891,
75.1979, 126.7588,
113.0480,
61.8302, 179.1860, 119.2285, 146.8109,
84.1786,
87.2220,
135.7181, 125.3407, 212.4108, 106.2447, 230.6277, 195.4263,
22.7461,
35.9729,
91.3233, 110.7092, 120.4467, 161.8475},
{83.8865,
83.9255, 109.9410,
118.9768, 133.9445, 172.9147, 151.0837,
32.4692, 154.8674, 160.5743,
151.8172, 185.5040, 136.3549,
86.3503, 112.5336,
-2.4509, 143.6643,
125.8473,
90.4448,
87.2646,
65.9669, 117.6135, 138.9672, 103.4819,
95.0051, 118.2011, 111.2620,
72.1367, 184.6274, 142.0455, 184.0470,
95.1135,
64.0642, 160.3825, 122.0600,
82.1896, 115.5435,
19.5575,
174.1959,
70.9405,
85.5756, 186.9740,
74.5378,
99.3571,
94.6918,
200.9874, 124.0450,
65.9472,
63.7741, 206.7838},
{216.8729, 201.7534,
57.2030,
109.3231, 110.0534, 135.3750,
91.3837,
71.1176,
97.6595, 174.1046,
238.6324, 131.4644, 106.6688, 155.0836,
95.6205, 213.1240, 175.3426,
58.6217,
86.5057, 187.0465, 139.4042, 139.6529,
34.6333, 131.3929,
154.2816,
88.1605,
69.8697, 110.7190,
67.2984, 116.4230, 133.9599,
188.6638, 128.9921,
92.8992, 201.7095, 161.2608, 131.5381, 153.5817,
94.5961, 162.8176, 133.4252, 151.2488,
67.6331, 196.7835, 141.7213,
24.1432, 143.4970, 183.7176, 151.9271, 189.0391}};
char
label[5][15]={{“Bank 1”},{“Bank 2”},{“Bank 3”}, {“Bank 4”},
{“Bank 5”}};
int
dataMax[5]={50,50,50,50,50};
#include
//Returns the validated number of measurements for a batch
int GetNumMeasurements(){
int numMeasurements;
printf(“How many measurements are there for this batch: “);
scanf(“%d”, &numMeasurements);
while(numMeasurements < 1){
printf("Number of measurements must be atleast 1.n");
printf("How many measurements are there for this batch: ");
scanf("%d", &numMeasurements);
}
return numMeasurements;
}
//Returns a single validated measurement from the user
int GetMeasurement(int num, int min, int max){
int measurement;
printf("Please enter a measurement %d: ", num);
scanf("%d", &measurement);
while(measurement < min || measurement > max) {
printf(“The measurement must fall in the range between the
expected minimum and maximumn”);
printf(“Please enter a measurement %d: “, num);
scanf(“%d”, &measurement);
}
return measurement;
}
//Returns the updated value for a given bin based on a measurement
int UpdateBin(int min, int max, int measurement){
int diff = (max – min) / 5;
if(measurement >= min && measurement < min + diff)
return 1;
else if(measurement >= min + diff && measurement < min + diff * 2)
return 2;
else if(measurement >= min + diff * 2 && measurement < min + diff * 3)
return 3;
else if(measurement >= min + diff * 3 && measurement < min + diff * 4)
return 4;
else
return 5;
}
//Draw the graph
void DrawGraph(int max, int min, int totalMeasurements, int bin1, int
bin2, int bin3, int bin4, int bin5){
int i;
for(i = totalMeasurements; i > 0; i–){
if(i % 2 == 0)
printf(“%3d %c “, i, (char)(179));
else
printf(“%5c “, (char)(179));
//hist data
printf(” %ct%ct%ct%ct%cn”, (i <= bin1 ? (char)(219) : ' '),
(i <= bin2 ? (char)(219) : ' '),
(i <= bin3 ? (char)(219) : ' '), (i
<= bin4 ? (char)(219) : ' '),
(i <= bin5 ? (char)(219) : ' '));
}
printf("
%c", (char)(192));
//print x axis
for(i = 0; i < 50; i++){
printf("%c", (char)(196));
}
int diff = (max - min) / 5;
printf("n
%dt%dt%dt%dt%dnn", min, min + diff, min + diff
* 2, min + diff * 3, min + diff * 4);
}
int main(void){
//read min and max
int min, max;
printf("Please enter the minimum and maximum values for the
measurements: ");
scanf("%d %d", &min, &max);
while(min > max || max – min <= 5) {
if(min > max){
printf(“The values entered (%d and %d) are not valid. the
minimum value shoud benless than the maximum.nn”, min, max);
}
if(max – min <= 5){
printf("The values entered (%d and %d) must have a difference
of at least 5.nn", min, max);
}
printf("Please enter the minimum and maximum values for the
measurements: ");
scanf("%d %d", &min, &max);
}
char batch;
int bin1 = 0, bin2 = 0, bin3 = 0, bin4 = 0, bin5 = 0;
int measurements, m, i, totalMeasurements = 0;
do{
//read measurements for batch
measurements = GetNumMeasurements();
totalMeasurements += measurements;
for(i = 1; i <= measurements; i++){
//update bin after each measurement
m = GetMeasurement(i, min, max);
switch(UpdateBin(min, max, m)){
case 1: bin1++; break;
case 2: bin2++; break;
case 3: bin3++; break;
case 4: bin4++; break;
case 5: bin5++; break;
}
}
//check for another patch
printf("Do you have another batch(Y/N): ");
scanf(" %c", &batch);
} while(batch == 'y' || batch == 'Y');
printf("nn");
//draw graph
DrawGraph(max, min, totalMeasurements, bin1, bin2, bin3, bin4, bin5);
system("PAUSE");
return 0;
}
...
Purchase answer to see full
attachment
Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.
You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.
Read moreEach paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.
Read moreThanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.
Read moreYour email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.
Read moreBy sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.
Read more