Course Solutions Uncategorized (Solved) : Must Written C Create Class Named Ice Cream Cone Fields Flavor Number Scoops Type Cone Pr Q30330523 . . . .

(Solved) : Must Written C Create Class Named Ice Cream Cone Fields Flavor Number Scoops Type Cone Pr Q30330523 . . . .

 

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<iostream>

#include<string>

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

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post