Answer:
// here is code in Java.
// package
import java.util.*;
// class definition
class Main
{
// method that return sum of two sale value
public static int Add(int euroSales,int asiaSales)
{
// return the sum
return euroSales+asiaSales;
}
//main method of the class
public static void main (String[] args) throws java.lang.Exception
{
try{
// variables
int euroSales=100;
int asiaSales=150;
int eurasiaSales;
// call the function
eurasiaSales=Add(euroSales,asiaSales);
// print the sum
System.out.println("total sale is:"+eurasiaSales);
}catch(Exception ex){
return;}
}
}
Explanation:
Declare and initialize two variables "euroSales=100" and "asiaSales=150". Declare another variable eurasiaSales. Call the method Add() with euroSales and asiaSales as parameter. This method will add both the value and return the sum.This sum will be assigned to variable eurasiaSales.Then print the sum.
Output:
total sale is:250
Answer:
Explanation:
The below code shows the complete code for the project. we have used Math.random() as a means of generating a random double value in the getRandom() method since it is not specified.
class Random {
![\ \ \ \ \ \ \ \ \mathbf{ public \ static \ void \ main \ (String[] \ args) \ \ \{}](https://tex.z-dn.net/?f=%5C%20%5C%20%5C%20%5C%20%5C%20%5C%20%5C%20%5C%20%5Cmathbf%7B%20%20public%20%20%5C%20static%20%5C%20%20void%20%20%5C%20main%20%5C%20%28String%5B%5D%20%5C%20%20args%29%20%5C%20%5C%20%20%20%5C%7B%7D)
perform(new MyGenerator());
}


}
public static <T extends Generator> void perform(T g) {

}
// MyGenerator class inherited from Generator
public static class MyGenerator extends Generator {
// implementing abstract method getRandom() of Generator class


//returning a single double value between 0.0 and 1.0

}
}
}
/*OUTPUT (will be random)*/
0.53296649765
The gateway works at the network layer is the Layer 3 of the OSI Model. The door is utilized when transmitting parcels. At the point when parcels are sent over a system, the goal IP address is inspected. On the off chance that the goal IP is outside of the system, then the bundle goes to the door for transmission outside of the system.
It visually groups the statements that belong together, and allows you to quickly see the flow of a program by looking at the indents.