I am not understanding the question below at all can someone please guide me in the right direction. I do understand what a Boolean is but i am unclear on how to change the code as directed below.
Thank you for your time.
Change the java code below so that frostCake returns a boolean value:
import java.awt.*;
public class Cake {
int topLocation;
int leftLocation;
String cakeFlavor;
public Cake(int top, int left) {
topLocation = top;
leftLocation = left;
}
public Cake(int top, int left, String flavor) {
topLocation = top;
leftLocation = left;
cakeFlavor = flavor;
}
public void frostCake(Color myColor, Graphics g) {
g.setColor(myColor);
g.fillRect(leftLocation, topLocation, 50, 50);
g.setColor(Color.black);
g.drawString("I am a" + cakeFlavor + "Cake.", leftLocation + 50, topLocation + 50);
}
public static String combine(String firstString, String secondString){
String combinedString = firstString + secondString;
return combinedString;
}
}