Q>Design a class BIGBAZAR to store order information. Each order information has an 11-character item code, 20- character item name, price and an integer quantity. Provide the following member functions in a class:-
1. member functions to read these records from standard input getdata(),
2. to calculate the total price calculate(){private member function)
3. sort functions to arrange data by ItemCode sort(),
4. to dispay the same and display the totalprice display().
Also use static variable count and static member function displaycount() to display the number of records.
Example:
ItemCode ItemName Quantity Price totalprice Units
BIGBAZZAR5 Sugar 1 40 40 Kg
BIGBAZZAR2 Potato 2 60 120 Kg
BIGBAZZAR1 Milk 1 30 30 Liter
BIGBAZZAR4 BOWL 5 130 650 _
BIGBAZZAR3 BUCKET 1 80 80 _
answer:
#include<conio.h>
#include<iostream.h>
class BIGBAZAR
{
int t_price;
int qty;
int price;
char item_code[11];
char item_name[20];
char units[6];
static int count;
void calculate()
{
My doubts: Basically, i cant understan the use of pointer here? why are we using pointers and when it is defined p[] is used...i dont understand how it is written ...cant p[0] or &p be used...and when it is called &p[0] is used....I am not able to understand anyting... :(((( .... plssss help
My question is that in this program i cant understand the function sort.
In this program various items are being entered by the user and displayed after sorting the item code. The itemcode is in the form BIGBAZAR4( BIGBAZAR and then the no.)(bigbazar is a name of indian retail shop). so i am sorting the 9th element in the array...but i cant uderstand how the programme is being declared,defined and called...