Computers and Technology

Public class DebugBox {
private int width;
private int length;
private int height;
public DebugBox()
{
length = 1;
width = 1;
height = 1;
}
public DebugBox(int width, int length, int height)
{
width = width;
length = length;
height = height;
}
public void showData()
{
System. out. println("Width: " + width + "Length: " +
length + "Height: "+ height);
}
public double getVolume()
{
double vol = length * width * height;
return vol;
}
}

// This class uses a DebugBox class to instantiate two Box objects
public class DebugFour3
{
public static void main(String args[])
{
int width = 12,
length = 10,
height = 8;
DebugBox box1 = new DebugBox();
DebugBox box2 = new DebugBox(width, length, height);
System. out. println("The dimensions of the first box are");
box1.showData();
System. out. print("The volume of the first box is ");
showVolume(box1);
System. out. println("The dimensions of the second box are");
box2.showData();
System. out. print("The volume of the second box is ");
showVolume(box2);
}
public static void showVolume(DebugBox aBox)
{
double vol = aBox. getVolume();
System. out. println(vol);
}
}

answer
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 23.06.2019 07:30, jackie0833
Which option allows you to view slides on the full computer screen?
Answers: 1
image
Computers and Technology, 24.06.2019 12:30, tragicteekaay
Nikki sent flyers in the mail to all houses within the city limits promoting her computer repair service what type of promotion is this and example of
Answers: 1
image
Computers and Technology, 24.06.2019 12:50, opgbadwolf5
When is it most apprpriate for a development team to change the definition of done
Answers: 1
image
Computers and Technology, 24.06.2019 17:40, finedock
Anewly established internet company with 40 employees needs your advice. they are looking for a collaboration tool and have narrowed their choices to gotomeeting, webex, and my web conferences. after reading the information presented in this chapter and other sources, prepare a two- page document ( double spaced) that includes two advantages and two disadvantages of each tool. which one is your final recommendation? why did you choose that tool over the other two?
Answers: 3
Do you know the correct answer?
Public class DebugBox {
private int width;
private int length;
private int height...

Questions in other subjects:

Konu
Mathematics, 15.09.2020 01:01
Konu
Mathematics, 15.09.2020 01:01
Konu
Chemistry, 15.09.2020 01:01
Konu
English, 15.09.2020 01:01
Konu
Social Studies, 15.09.2020 01:01
Konu
Mathematics, 15.09.2020 01:01
Konu
Geography, 15.09.2020 01:01
Konu
Mathematics, 15.09.2020 01:01
Konu
Mathematics, 15.09.2020 01:01