Answer:
Written in C++
bool checkfloor(double num1, double num2, double num3) {
if(floor(num1 * num2) == floor(num3)){
return true;
}
else {
return false;
}
}
Explanation:
The function written in C++
This line defines the function
bool checkfloor(double num1, double num2, double num3) {
The following if condition checks if the floor of num1 * num2 equals num3
if(floor(num1 * num2) == floor(num3)){
return true; It returns true, if yes
}
else {
return false; It returns false, if otherwise
}
}
See attachment for full program including the main
Answer:
Following are the correct python code to this question:
n1 = float(input('Input first number: '))#input first number
n2 = float(input('Input second number: '))#input second number
n3 = float(input('Input third number: '))#input third number
n4 = float(input('Input fourth number: '))#input fourth number
average = (n1+n2+n3+n4)/4 #calculate input number average
product = n1*n2*n3*n4 # calculate input number product
print('product: {:.0f} average: {:.0f}'.format(round(product),round(average))) #print product and average using round function
print('product: {:.3f} average: {:.3f}'.format(product,average)) #print product and average value
Output:
Please find the attachment.
Explanation:
The description of the above python code can be defined as follows:
- In the above python program four variable "n1, n2, n3, and n4" is defined, in which we take input from the user end, and in these user inputs we use the float method, that converts all the input value in to float value.
- In the next step, two variable average and product are defined, that calculate all input numbers product, average, and hold value in its variable.
- In the last line, the print method is used, which prints its variable value by using a round and format method.
Answer:
The correct Answer is 0.0571
Explanation:
53% of U.S. households have a PCs.
So, P(Having personal computer) = p = 0.53
Sample size(n) = 250
np(1-p) = 250 * 0.53 * (1 - 0.53) = 62.275 > 10
So, we can just estimate binomial distribution to normal distribution
Mean of proportion(p) = 0.53
Standard error of proportion(SE) =
=
= 0.0316
For x = 120, sample proportion(p) =
=
= 0.48
So, likelihood that fewer than 120 have a PC
= P(x < 120)
= P( p^ < 0.48 )
= P(z <
) (z=
)
= P(z < -1.58)
= 0.0571 ( From normal table )