Answer:
Answered below
Explanation:
//Program is written in Java programming //language
Class Box{
private double length;
private double width;
private double height;
Box(double len, double wid, double hgt){
length = len;
width = wid;
height = hgt;
}
public double volumeOfBox( ){
double volume = length * width * height;
return volume;
}
public double getLength( ){
return length;
}
public double getWidth( ){
return width;
}
public double getHeight( ){
return height;
}
}
Answer:
Following are the code in Java Language:
Scanner sc = new Scanner(System.in); // create a instance of scanner class
DecimalFormat frmt = new DecimalFormat("0.###"); // create a instance of // DecimalFormat class
System.out.println ("Enter the value: ");
double number = scan.nextDouble(); // Read the value by thje user
System.out.println (fmmt.format(Math.pow(number, 4))); // display the value
Explanation:
Following are the description of the code
- Create an instance scanner class i.e "sc".
- Create an instance of DecimalFormat class i.e "frmt".
- Read the value by the user in the "number" variable of type double by using the nextDouble()method.
- Finally, display the value by using System.out.println method. In this, we call the method format. The Math.pow() function is used to calculating the power up to the fourth value.
Roadway system would be the ebst choice
Word processor because it's more for writing