Answer:
Physical layer
Explanation:
The physical layer is responsible for the physical cable or wireless connection.
Answer:
#include<iostream>
using namespace std;
int main()
{
int length = 16;
int width = 18;
int perimeter = (2*length) + (2 * width);
cout<<"The perimeter is: "<<perimeter<<endl;
}
Explanation:
First include the library iostream in the c++ program for input/output.
then, create the main function and define the variable with given values in the length and width.
After that calculate the perimeter by using the formula.
perimeter = 2*length + 2*width
and finally display the output on the screen by using the cout instruction.
Answer:
The function in Python is as follows:
def digitSum( n ):
if n == 0:
return 0
if n>0:
return (n % 10 + digitSum(int(n / 10)))
else:
return -1 * (abs(n) % 10 + digitSum(int(abs(n) / 10)))
Explanation:
This defines the method
def digitSum( n ):
This returns 0 if the number is 0
<em> if n == 0:
</em>
<em> return 0
</em>
If the number is greater than 0, this recursively sum up the digits
<em> if n>0:
</em>
<em> return (n % 10 + digitSum(int(n / 10)))
</em>
If the number is lesser than 0, this recursively sum up the absolute value of the digits (i.e. the positive equivalent). The result is then negated
<em> else:
</em>
<em> return -1 * (abs(n) % 10 + digitSum(int(abs(n) / 10)))</em>
Answer: c) Run-time Exception
Explanation: Runtime Exception is the exception that works in the JVM(Java Virtual Machine) as a super-class. It can also act during the general working of the JVM and are not checked by any resources. The exception that are followed from the Runtime exception is Arithmetic exception and Null pointer exception as the subclass. Therefore ,the correct option is option(c).