Need Help With Project
I am working on a project for school and am having trouble getting started. I have to create a application that helps a user build an ice cream cone. I am currently working on the first two files, I just want someone to tell me if I am heading in the right direction as far as putting these first two files together. The instructions tell me to create an IceCreamConeException class whose constructor receives a String that consists of an ice cream cone's flavor and an integer representing the number of scoopsin the IceCreamCone. Pass the String to the IceCreamConeException's parent so it can be used in a get Message() call. In the IceCreamCone file I must create two fields flavor & scoops, the IceCreamCone constructor must call two data entry methods setFlavor() & setScoops(). The setScoops() method must throw an exception when scoop quantity exceeds three. Any suggestions or comments would be greatly appreciated.
public class IceCreamConeException extends Exception
int scoops, scps;
public IceCreamConeException(String flavor)
flav = flavor;
scps = scoops;
public class IceCreamCone
void setScoops() throws IceCreamConeException
if(scoops > 3)
throw (new IceCreamConeException());
JOptionPane.showMessageDialog(null, "You are only allowed a maximum of three scoops");
Such question has already took place in the forum i think twoweeks ago,you can search for it,and there you can find a solution.Good luck.