Answer:
void mn(int m, int n){
int sum = 0;
int count = 0;
if(m<n){
for(int i = m;i<=n;i++){
sum+=i;
}
}
else{
for(int i = n;i<=m;i++){
sum+=i;
}
}
count = abs(m - n)+1;
cout<<"Sum: "<<sum<<endl;
cout<<"Average: "<<(float)sum/count;
}
Explanation:
This line defines the method
void mn(int m, int n){
This initializes sum and count to 0
int sum = 0;
int count = 0;
This checks if m is less than n
if(m<n){
This iterates from m to n and calculates the sum of numbers between this interval
<em> for(int i = m;i<=n;i++){</em>
<em> sum+=i;</em>
<em> }</em>
<em> }</em>
If otherwise,
else{
This iterates from n to m and calculates the sum of numbers between this interval
<em> for(int i = n;i<=m;i++){</em>
<em> sum+=i;</em>
<em> }</em>
<em> }</em>
This calculates the range from m to n using absolute function
count = abs(m - n)+1;
This prints the calculated sum
cout<<"Sum: "<<sum<<endl;
This calculates and prints the average
cout<<"Average: "<<(float)sum/count;
}
<em>See attachment for complete program that includes the main (in c++)</em>
Answer:
The correct options are;
Mechanical
Faraday
Explanation:
The principle of working of electric generators is to convert kinetic energy, which is the energy present in the spinning turbine into electrical energy. Electricity is generated by the use of the electric generators has the largest share of all forms of electricity generated electricity and it is based on Faraday's law of of induction, which states that Emf = N×(ΔФ/Δt)
Where;
Emf = The induced voltage
ΔФ = Change in magnetic flux
Δt = Change in time.
Therefore, we have;
Traditional power-generating stations do not store electrical energy. In such power stations, the original energy source spins a turbine which an electric generator. It converts <u>mechanical </u>energy into electrical energy using a fundamental principle of physics called <u>Faraday's</u> law.
D. The answer for this is the gulp
It depends on what digital pen you're using.
Ink pens are better because they don't run out of ink like digital and you dont have to re-charge every time.
Hope this helps!:)<span />