Answer:
The solution code is written in C++.
- unsigned int SumOfDigits(int n){
- int sum = 0;
- sum += n % 10;
- n = n / 10;
-
- while(n != 0){
- sum += n % 10;
- n = n / 10;
- }
-
- return sum;
- }
Explanation:
Firstly, define a function with name <em>SumOfDigits()</em> that take one input integer, <em>n</em> and return an unsigned summation integer (Line 1). Next, we declare a variable sum to hold the value of summation of all the integer digits. Let's initialize it with zero (Line 2).
We can get the first digit from the integer by calculating the remainder of n after dividing it by 10 using modulus operator (%) and the remainder obtained is added to the sum variable (Line 3). Next, we divide the integer n by 10 (Line 4). This will discard the last digit of integer n (from the right).
We just need to repeat the process from Line 3-4 using a while loop so long as the current integer n is not zero (Line 6-8). We shall be able to take out the individual digit and add it to variable<em> sum</em>.
At the end, return the <em>sum</em> as output (Line 11).
Answer:
It only detects errors if an odd number of bit flips have occurred.
Explanation:
Parity is a measure of how even or odd a string of digits (for example, a string of binary units is). It is obtained by calculating the value of all the bits. Parity is used in error detection. A parity error is detected when the parity and the odd number of bits are incorrectly propagated.
A problem commonly associated with the parity bits is that they can only detect an odd number of bit errors. This means that if a digit is corrupted in the even binary digits there would be an incorrect detection of errors.
Answer:critical stress= 20.23 MPa
Explanation:
Since there was an internal crack, we will divide the length of the internal crack by 2
Length of internal crack, a = 0.7mm,
Half length = 0.7mm/2= 0.35mm changing to meters becomes
0.35/ 1000= 0.35 x 10 ^-3m
The formulae for critical stress is calculated using
σC = (2Eγs /πa) ¹/₂
σC = critical stress=?
Given
E= Modulus of Elasticity= 225GPa =225 x 10 ^ 9 N/m²
γs= Specific surface energy = 1.0 J/m2 = 1.0 N/m
a= Half Length of crack=0.35 x 10 ^-3m
σC= (2 x 225 x 10 ^ 9 N/m² x 1.0 N/m /π x 0.35 x 10 ^-3m)¹/₂
=(4.5 x 10^11/π x 0.35 x 10 ^-3)¹/₂
=(4.0920 x10 ^14)¹/₂
σC=20.23 x10^6 N/m² = 20.23 MPa
Answer:
-effective technical skills.
-the ability to work under pressure.
-problem-solving skills.
-creativity.
-interpersonal skills.
-verbal and written communication skills.
-commercial awareness.
-teamworking skills.
Explanation:
is this what ur looking for? if so there ya go lol