They are several weaknesses or disadvantages of file processing
systems but the major weakness is data redundancy and inconsistency. By data
redundancy, I mean duplication of data. There are no better methods to validate
insertion of duplicate data in file systems. Data redundancy can also increase
the chance for errors.
A Human-Machine Interface (HMI) is a graphic terminal that allows the robot operator to control, monitor, and collect data from the robot system.
(https://www.robots.com/faq/what-is-a-hmi)
Answer:
// program in C.
// headers
#include <stdio.h>
// headers
#include <stdlib.h>
// headers
#include <limits.h>
// main function
int main(int argc, char** argv)
{
// read value of N from command line arguments
int N=atoi(argv[1]);
// variables
int max=INT_MIN;
// variable
int min=INT_MAX;
int rA[N],i;
// fill the array with random number
for(i=0;i<N;i++)
{
// generate random number from -50 to +50
rA[i]=rand()%101-50;
// find the Maximum
if(rA[i]>max)
max=rA[i];
// find the Minimum
if(rA[i]<min)
min=rA[i];
}
// print values of array
printf("values of the array are:");
for(i=0;i<N;i++)
{
printf("%d ",rA[i]);
}
// print Maximum
printf("\nMaximum value is:%d",max);
// print Minimum
printf("\nMinimum value is:%d",min);
return 0;
}
Explanation:
Read value of N from command line.Then create an array of size N.Fill the array with random number from -50 to +50.Then find the Maximum of all the elements and assign it to variable "max" and find Minimum from all and assign it to variable "min". then print all the elements of the array, Minimum and Maximum.
Output:
command line argument=10
values of the array are:-18 -18 4 -38 2 6 -42 -20 -6 44 -6 -11 15 -31 1
Maximum value is:44
Minimum value is:-42
Answer in Python:
<em># Define program constants</em>
PI = 3.14
radius = 8
height = 5
<em># Welcome the user to our program</em>
print("### Calculating volume of Cylinder with Radius of 8m and Height of 5m...")
<em># Calculate the volume</em>
volume = PI * radius ** 2 * height
<em># Print the result</em>
print("The cylinder volume is:", volume, "m³")
References:
- https://www.w3schools.com/python/python_variables.asp
- https://www.w3schools.com/python/python_operators.asp
- https://www.w3schools.com/python/ref_func_print.asp