Answer:
The definition of a class Telephone is given as
public class Telephone // class telephone
{
String number; // variable number of type string
static int quantity = 250;
// variable quantity of type int
static double total = 1565.92; // variable total of type double
}
Explanation:
Following is the description of Statement
- Create a class "Telephone" by using the keyword class.In that class we declared data member .
- We declared a variable "number" of type "string" which has no constructor.
- We declared a variable "quantity" of type "int" which is a static type variable. The static type variable retains the value during the program execution.
- We declared a variable "total" of type "double" which is a static type variable. The static type variable retain the value during the program execution .
Here you go,
Import java.util.scanner
public class SumOfMax {
public static double findMax(double num1, double num2) {
double maxVal = 0.0;
// Note: if-else statements need not be understood to
// complete this activity
if (num1 > num2) { // if num1 is greater than num2,
maxVal = num1; // then num1 is the maxVal.
}
else { // Otherwise,
maxVal = num2; // num2 is the maxVal.
}
return maxVal;
}
public static void main(String[] args) {
double numA = 5.0;
double numB = 10.0;
double numY = 3.0;
double numZ = 7.0;
double maxSum = 0.0;
/* Your solution goes here */
maxSum = findMax(numA, numB); // first call of findMax
maxSum = maxSum + findMax(numY, numZ); // second call
System.out.print("maxSum is: " + maxSum);
return;
}
}
/*
Output:
maxSum is: 17.0
*/
New Subnet Mask:
255.255.255.240
First 4 subnetwork Addresses:
197.14.88.0
197.14.88.16
197.14.88.32
197.14.88.48