Must be written in C++. Create a class named Ice Cream Cone with fields for flavor,number of scoops, type of cone, and price. Unless arguments aresupplied, flavor defaults to “Vanilla”, number of scoops defaultsto 1, and cone type defaults to “Sugar”. The constructor calculatesthe price based on 75 cents per scoop, with an additional 40 centsfor a waffle cone. Write a main() function demonstrating that theclass works correctly. Save the file as IceCreamCone.cpp. Here is what I have but it’s not working.. //IceCreamCone.cpp #include #include using namespace std; class IceCreamCone { private: string flavor; int scoops; string cone; double price; public: IceCreamCone(); IceCreamCone(string flavor, int scoops, string cone, doubleprice); void calculate(); void print(); }; IceCreamCone::IceCreamCone() { flavor=”Vanilla”; scoops=1; cone=”Sugar”; } IceCreamCone::IceCreamCone(string flavor, int scoops, stringcone) { this->flavor=flavor; this->scoops=scoops; this->cone=cone; calculate(); } void IceCreamCone::calculate() { const double perScoop=0.75; const double waffle=0.40; if(cone==”waffle”) price=perScoop+waffle; else price=scoops*perScoop; } void IceCreamCone::print() { cout . . .
#Sales Offer!| Get upto 25% Off: