Answer:
HTML
Explanation:
HTML stands for <em>"Hypertext Markup Language." </em>It allows the creation of electronic documents which use <em>semantics</em> to indicate a particular text. The different HTML elements are being separated by<em> "angle brackets" </em>in order to make up a tag. These tags are not visible, but they make it possible for the browser's page to be interpreted.
Answer:
Below are the function for the above question in java Language---
void show_info(String name,String home,String state)
{
System.out.println("Your name is "+name+" and you live in "+ home+" ,"+state +".");
}
Output:
- If the user inputs name="Gaus",city="LosAngeles" and state="California" then the output will be "Your name is Gaus and you live in LosAngeless, California."
Explanation:
- The above function is in java language which takes three argument names, state, and the city.
- The name will be stored on the name variable of the string type.
- The state will be stored on the state variable of string type.
- The city will be stored on the city variable of the string type.
- Then the Output will be displayed with the help of the print function.
- '+' is used to merge the string.
Answer:
Explanation:
The following is written in Java and has the methods as requested in the question...
class Dog {
private double age;
public Dog(double v) {
assert v >= 0:" Not valid";
this.age = v;
}
public boolean isOlder(Dog dog1, Dog dog2) {
if (dog1.age > dog2.age) {
return true;
} else {
return false;
}
}
}
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:
rs 35.6ko vrs 12. r7 3.3ko vrt 13.