The answer is true because choosing a technology solution is the last step
Answer:
The code to the given question can be given as:
Code:
1)
2 arrays that used to store 10 employee identification number and grosspay amount in parallel and its data-type is int and double.
int Employee_id[10]; //array that store integer value
double Weekly_Gross_Pay[10]; //array that store double value
2)
Define loop for print the details of employees’ identification number and weekly gross pay.
for(int i=0; i<10; i++)
{
cout <<Employee_id[i] <<" " << Weekly_Gross_Pay[i] << endl;
}
Explanation:
The explanation of the above code can be given as:
In Code (1) we declare two array that's data-type is integer and double. In Employee_id array it store the integer values and Weekly_Gross_Pay it store the double value.
In Code(2) It is used to print the value of array. In that code, we used for a loop because of its entry control loop and we know the size of the array. In this loop, we declare a variable (i) and initialized the value 0 and check the condition(i)less than 1 and increment of i. It prints all the 10 values.
Answer:
Following are the statement in C++ language :
#include <iomanip> // header file
using namespace std; // namespace
int main() // main method
{
int x1,x2,x3,x4,x5; // variable declaration
cout<<" Enter the 5 sucessive integer:";
cin>>x1>>x2>>x3>>x4>> x5; // taking 5 input from user
cout<<right;
// prints each of its own line and form a right-justified
cout<<setw(5)<< x1 << "\n" << setw(5) << x2 << "\n" <<setw(5) << x3 << "\n" << setw(5) << x4 << "\n" << setw(5) << x5 << "\n";
return(0);
}
Output:
Enter the 5 sucessive integer: 45
23
445
6
8
45
23
445
6
8
Explanation:
Description of program is given below
- Declared a 5 integer value x1,x2,x3,x4,x5 respectively.
- Read the 5 integer value from user by using cin funtion.
- Finally Print these 5 value in its own line and form a right-justified by using setw() function on it
Answer:
- import math
-
- def standard_deviation(aList):
- sum = 0
- for x in aList:
- sum += x
-
- mean = sum / float(len(aList))
-
- sumDe = 0
-
- for x in aList:
- sumDe += (x - mean) * (x - mean)
-
- variance = sumDe / float(len(aList))
- SD = math.sqrt(variance)
-
- return SD
-
- print(standard_deviation([3,6, 7, 9, 12, 17]))
Explanation:
The solution code is written in Python 3.
Firstly, we need to import math module (Line 1).
Next, create a function standard_deviation that takes one input parameter, which is a list (Line 3). In the function, calculate the mean for the value in the input list (Line 4-8). Next, use the mean to calculate the variance (Line 10-15). Next, use sqrt method from math module to get the square root of variance and this will result in standard deviation (Line 16). At last, return the standard deviation (Line 18).
We can test the function using a sample list (Line 20) and we shall get 4.509249752822894
If we pass an empty list, a ZeroDivisionError exception will be raised.
Answer:
if full_admission_price = f and discount_amount = d
=> Price of a discount admission = d/f
total_weight
quantity
weight of one item = total_weight/quantity
for i in range(80, 18, -2):
print(i, end=' ')
Explanation:
The first two questions are just mathematical to get a single quantity given some relationship. So, its basically division
For the python code, I used the python's range function which takes in three arguments. The first one is the starting value, the second one is the terminating value which is the number before the terminating value and the last one specifies the common difference popularly known as step in the language. Since the step is 2, only even numbers are printed out. In the print function, I made use of the end keyword specifying a space (' ') as the end. This ensures that the print is done in the same line with a space seperating them. Without that specification, each result will printed in a newline