Evilsithgirl
04-15-2008, 06:40 PM
I am having problems understanding how to complete this task.
• Specify by how much larger (multiplier) you would like to enlarge each dimension of the object. For example, makeLarger(2) would multiply the length, width, and height of the box by 2.
• Specify the specific amount you would like to add to each dimension of the box. For example, makeLarger(1, 3, 5) would add 1 to the length, 3 to the width, and 5 to the height of the box
my code that i have written in order to make the boxes looks like this:
public class Box1 {
double length;
double width;
double height;
Box1() {
length = 10;
width = 10;
height = 10;
}
//makes a defalt box
Box1(double l, double w, double h) {
length = l;
width = w;
height = h;
}
//makes a user created box
Box1(double s){
length = s;
width = s;
height = s;
}
//makes a cube
any tips on how to make a method to peform the objectives in the task above?
• Specify by how much larger (multiplier) you would like to enlarge each dimension of the object. For example, makeLarger(2) would multiply the length, width, and height of the box by 2.
• Specify the specific amount you would like to add to each dimension of the box. For example, makeLarger(1, 3, 5) would add 1 to the length, 3 to the width, and 5 to the height of the box
my code that i have written in order to make the boxes looks like this:
public class Box1 {
double length;
double width;
double height;
Box1() {
length = 10;
width = 10;
height = 10;
}
//makes a defalt box
Box1(double l, double w, double h) {
length = l;
width = w;
height = h;
}
//makes a user created box
Box1(double s){
length = s;
width = s;
height = s;
}
//makes a cube
any tips on how to make a method to peform the objectives in the task above?