Answer:
Codes for each of the problems are explained below
Explanation:
PROBLEM 1 IN C++:
#include<iostream>
using namespace std;
//fib function that calculate nth integer of the fibonacci sequence.
void fib(int n){
// l and r inital fibonacci values for n=1 and n=2;
int l=1,r=1,c;
//if n==1 or n==2 then print 1.
if(n==1 || n==2){
cout << 1;
return;
}
//for loop runs n-2 times and calculates nth integer of fibonacci sequence.
for(int i=0;i<n-2;i++){
c=l+r;
l=r;
r=c;
cout << "(" << i << "," << c << ") ";
}
//prints nth integer of the fibonacci sequence stored in c.
cout << "\n" << c;
}
int main(){
int n; //declared variable n
cin >> n; //inputs n to find nth integer of the fibonacci sequence.
fib(n);//calls function fib to calculate and print fibonacci number.
}
PROBLEM 2 IN PYTHON:
def fib(n):
print("fib({})".format(n), end=' ')
if n <= 1:
return n
else:
return fib(n - 1) + fib(n - 2)
if __name__ == '__main__':
n = int(input())
result = fib(n)
print()
print(result)
Answer:
a = 1.68m/
Explanation:
Please kindly find the attached file for explanations
Answer:
Exact answer: a form of energy resulting from the existence of charged particles (such as electrons or protons), either statically as an accumulation of charge or dynamically as a current.
Answer:
The rate of entropy change of the air is -0.10067kW/K
Explanation:
We'll assume the following
1. It is a steady-flow process;
2. The changes in the kinetic energy and the potential energy are negligible;
3. Lastly, the air is an ideal gas
Energy balance will be required to calculate heat loss;
mh1 + W = mh2 + Q where W = Q.
Also note that the rate of entropy change of the air is calculated by calculating the rate of heat transfer and temperature of the air, as follows;
Rate of Entropy Change = -Q/T
Where Q = 30Kw
T = Temperature of air = 25°C = 298K
Rate = -30/298
Rate = -0.100671140939597 KW/K
Rate = -0.10067kW/K
Hence, the rate of entropy change of the air is -0.10067kW/K