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:
b. Discharging; anode; cathode
Explanation:
When discharging , it means the battery is producing a flow electric current, the lithium ions are released from the anode to the cathode which generates the flow of electrons from one side to another. When charging Lithium ions are released by the cathode and received by the anode.
Answer:
Timing Diagrams 15 pts. A 10 MHz clock that generates a 0 to 5V pulse train with a 30% duty cycle is connected to input X of a two input OR gate that has a 20nS propagation delay. The clock also goes to an inverter with a 10 ns propagation delay. The output of the inverter goes to the Y input of the OR gate. a) Draw the circuit. 2 pts. b) Plot the output of the clock for two cycles. Show times and voltages. 5 pts. c) On the same page as part (b) plot the output of the inverter. Show times and voltages. 3 pts. d) On the same page as parts (b & c) plot the output of the OR gate. Show times and voltages. 5 pts.
Answer:
Answer for the question:
1. A compressed air system consists of a compressor and receiver, 1500 ft of 4-in pipe, two gate valves, six standard elbows, and a manifold. Four rock drills requiring 200 cu-ft/min each are connected to the manifold by 1.25-in hoses 100 ft long. Pressure drop in the manifold is 3 psig and line leakage is 5%. Determine the pressure at the drill when all four drills are operating simultaneously and receiver pressure is 100 psig.
is explained in the attachment.
Explanation: