You should specify what language you're using in these types of questions; here's an example in C++.
#include <iostream>
#include <math>
int main()
{
// example area
double area = 25;
// square root the area to find the length
// then apply basic pythagoras
double diagonal = sqrt(pow(sqrt(area), 2) + pow(sqrt(area), 2));
return 0;
}
Answer:
The power function can be written as a recursive function (using Java) as follows:
- static int power(int x, int n)
- {
- if(n == 0){
- return 1;
- }
- else {
- return power(x, n-1 ) * x;
- }
- }
Explanation:
A recursive function is a function that call itself during run time.
Based on the question, we know x to the 0th power is 1. Hence, we can just create a condition if n = 0, return 1 (Line 3 - 5).
Next, we implement the logic "x to the nth power can be obtained by multiplying x to the n-1'th power with x " from the question with the code: return power(x, n-1 ) * x in the else block. (Line 6 -8)
In Line 7, power() function will call itself recursively by passing x and n-1 as arguments. Please note the value of n will be reduced by one for every round of recursive call. This recursive call will stop when n = 0.
Just imagine if we call the function as follows:
int result = power(2, 3);
What happen will be as follows:
- run Line 7 -> return power(2, 2) * 2
- run Line 7 -> return power(2, 1) * 2
- run Line 7 -> return power(1, 0) * 2
- run Line 4 -> return 1 (Recursive call stop here)
Next, the return value from the inner most recursive call will be return to the previous call stack:
- power(1, 0) * 2 -> 1 * 2
- power(2, 1) * 2 -> 1 * 2 * 2
- power(2, 2) * 2 -> 1 * 2 * 2 * 2 - > 8 (final output)
Answer:
Tech B is correct.
Explanation:
First, It is international best practice never to exceed the lifting capacity of any hoist. To do so would expose those involved to risks that may prove to be fatal.
Second, research has shown that gasoline vapors, as well as vapor from almost all other flammable or ignitable liquids or substances, are heavier than air.
More specifically, Gasoline produces flammable vapors that are heavier than air by 3 to 4 times. This means they can travel for great distances along the ground. Worst still, inspection pits are must be kept free from gas vapors because they tend to accumulate in low or enclosed spaces.
Both technicians should and must observe all occupational, health, and safety rules and guidelines stipulated and required for their industry/practice.
Cheers
Answer:
#include <iostream>
using namespace std;
void matrix(){
int row = 5, col = 6;
int myarr[row][col];
for (int i = 0; i < 5; i++){
for (int x = 0; x < 6; x++){
if (i == 0){
myarr[i][x] = (x+1)*(x+1);
}else if ( x == 0){
myarr[i][x] = (i+1)*(i+1)*(i+1);
} else if ( i == x){
myarr[i][x] = (i+1);
} else{
myarr[i][x] = myarr[i-1][x] + myarr[i][x-1];
}
}
}
for (int i = 0; i < 5; i++){
for (int x = 0; x < 6; x++){
cout<< myarr[i][x] << " ";
}
cout<< "\n";
}
}
int main(){
matrix();
}
Explanation:
The C++ source code defines a two-dimensional array that has a fixed row and column length. The array is a local variable of the function "matrix" and the void function is called in the main program to output the items of the array.
For a decentralized software application we associate a blockchain server.
<h3>What is a server?</h3>
A server can be defined as a dedicated computer system that is designed and developed to provide specific services to other computer devices or programs, which are commonly referred to as the clients.
<h3>Types of server.</h3>
In Computer technology, there are different types of server and these include the following:
- Web server
- Email server
- File server
- Database server
- Proxy server
- Distributed communication server
- Centralized Server
- Distributed application server
- Blockchain server
Generally, a web software application is associated with a web server, a mobile software application is associated with a mobile server, and a decentralized software application we associate a blockchain server.
Read more on web server here: brainly.com/question/27960093
#SPJ1