Answer:
// here is code in C++.
#include <bits/stdc++.h>
using namespace std;
int main()
{
// variable
int n;
int mi=INT_MAX;
int mx=INT_MIN;
double avg;
int count=0;
double sum=0;
cout<<"enter a positive integer(Negative number to stop):";
// read the input first time
cin>>n;
// read the input until user enter a negative number
while(n>=0)
{
// calculate minimum
if(n<mi)
mi=n;
// calculate maximum
if(n>mx)
mx=n;
// count of entered numbers
count++;
// total sum of all number
sum=sum+n;
cout<<"enter a positive integer(Negative number to stop):";
// read the input again
cin>>n;
}
// calculate the average
avg=sum/count;
// print the average
cout<<"average of "<<count<<" number is:"<<avg<<endl;
// print the maximum
cout<<"maximum of all number is:"<<mx<<endl;
// print the minimum
cout<<"minimum of all number is:"<<mi<<endl;
return 0;
}
Explanation:
Declare and initialize "mi" with maximum integer value.Similarly "mx" with minimum integer value.Read user input until user enter a negative number.Add all the number to variable "sum" and keep count of positive number entered with "count".When user enter a negative number then it will stop taking input and calculate average of all number by dividing sum with count. Also it will check for each and find the maximum and minimum among the all input.
Output:
enter a positive integer(Negative number to stop):23
enter a positive integer(Negative number to stop):10
enter a positive integer(Negative number to stop):34
enter a positive integer(Negative number to stop):22
enter a positive integer(Negative number to stop):5
enter a positive integer(Negative number to stop):-2
average of 5 number is:18.8
maximum of all number is:34
minimum of all number is:5
. If the sub-expression on the left of the __________ logical operator is true, the right
sub-expression is not checked.
Answer: "║"(OR) logical operator
Explanation: "ll" logical is used for defining the OR logical condition.This condition returns a value of true or false according to given expression.This expression can work on the Boolean variables only.
In this operator if any argument turn out to be true , the value returned is true otherwise the answer returned will be false.It also features that if the left side of this operator is true then the right sub-part of it's not evaluated as it becomes true overall.
Example of expression-> x ║ y ;
What is ‘White-Box’ testing?
Answer:
The white box testing is the method in which it basically test the internal structure and working application in the software testing.
In the white box testing the programming skills are require for designing the various test cases.
White box testing is also known as open box testing and it require the specific knowledge of the programming language for examine the particular software testing output.
Answer:
The White Box test is a software test in which the developer has access to the source code, knowing the internal structure of the product. Being analyzed and allowing the choice of specific parts of a component to be evaluated, allowing a precise search of the behavior of the structure.
The white box test levels are Unit Tests and Static Test.
Prove the following theorems using truth table (a) X + XY = X (b) X + YZ = (X + Y)(X + Z)
Answer:
I attached you the answer in the picture
Explanation:
First, let's see the relationship between the logic gates and truth tables:
The operation of logic gates in relation to one another may be represented and analyzed using a branch of mathematics called Boolean Algebra which, like the common algebra, deals with manipulation of expressions to solve or simplify equations. Expressions used in Boolean Algebra are called, well, Boolean expressions.
AND Gate:
The AND gate is a logic gate that gives an output of '1' only when all of its inputs are '1'. Thus, its output is '0' whenever at least one of its inputs is '0'. Mathematically, A∧B = A · B.
OR Gate:
The OR gate is a logic gate that gives an output of '0' only when all of its inputs are '0'. Thus, its output is '1' whenever at least one of its inputs is '1'. Mathematically, A∨B = A + B.
Having this in mind, we just need to use basic Mathematical Logic operations