this is the output:
run:
Diameter of Pizza Area of Pizza Price Price/SQ Inch
12.00 113.10 $4.00 0.0354
12.00 113.10 ...
Type: Posts; User: m7abraham
this is the output:
run:
Diameter of Pizza Area of Pizza Price Price/SQ Inch
12.00 113.10 $4.00 0.0354
12.00 113.10 ...
haha yeah took a lot of brain storming!!!
but i still get the same output for some reason
this is what my program looks like now:
/* This class calculates the area of a pizza and
* the...
is this correct?
public Pizza(Pizza pi) {
diameter = pi.diameter;
price = pi.price;
}
ok sorry... :confused:
just one question
whats "this" in the program
based on the example i think this is how it should be done... but its still giving me the same output :/
public Pizza(Pizza pi) {
pi.getDiameter();
pi.getPrice();
...
thanks :)
got this one fixed
public double calculateArea() {
double radius = diameter / 2;
double area = Math.PI * radius * radius;
return area;
}
did i get it right this time? haha
public Pizza(Pizza pi) {
pi.getDiameter();
pi.getPrice();
}
and i think i got this one right too:
for the first part... are the two fields(diameter, price)?
is this what i'm suppose to do?
public Pizza(Pizza pi) {
diameter = 12.0;
price = 4.00;
}
for this part the instruction is: "copy constructor the creates an exact copy of the passed pizza object pi."
public Pizza(Pizza pi) {
}
the error message that im getting is this:
I wrote almost the entire class other than one thing that i'm confused about which is this:
public Pizza(Pizza pi) {
}
the rest of the coding is done. when i test it it says that...