You are on page 1of 2

A breakfast chain restaurant wants to create a c++ based management software for billing,

procurement, taxation, ingredient management, etc.

Create a class named “tiffin”, which can hold the unique item number (int), the name of
the item (char, max size 10), cooking time (float), batter type (int), cooking cost (float), final
price ( cooking cost, 50% profit and tax included ).

The class should contain a static data “tax”, which is the food tax (10%).

1. Write the default constructor that assigns 0 to all variables except the item name (char
type). The default name of the item name is “noname”.
The constructor should also print “Item created”

2. Write the destructor which prints “Item deleted”

3. Write two member functions:

a. A function that reads the input variables and also calculates the final price.
b. A function that prints the output variables, separated by space.

4. First, call the function 3 (b).

5. Second, call the function 3 (a).

6. Third, call the function 3 (b).

Create ONLY 3 objects.


HINT: Use string.h to call strcpy(destination, source) to assign a character array to
another.

INPUT (Item number, item name, batter type, cooking time, cooking cost)

1 idly 1 360.0 6.0


2 dosa 3 100.0 13.0
3 wada 2 500.0 16.0

OUTPUT (item number, item name, price)


All are separated by space

Item created
Item created
Item created
0 noname 0
0 noname 0
0 noname 0
1 idly 9.6
2 dosa 20.8
3 wada 25.6
Item deleted
Item deleted
Item deleted

You might also like