Program to display stock containing item code, C/C++ Programming

 THIS PROGRAM IS TO DISPLAY A STOCK CONTAINING ITEM CODE,ITEM NAME,PRICE AND ANOTHER STOCK WITH CODE & QUANTITY AND DISPLAY COMPLETE INFORMATION

#include
#include
#include
struct stock
  {
  int itemcode;
  char itemname[30];
  float unitprice;
  };

struct stock1
  {
  int itemcode;
  int quantity;
  };

void main()
    {
    clrscr();
    stock s[50];
    stock1 s1;
    float amt;
    int number;
    cout<<"enter the no. of items to be purchased : ";
    cin>>number;
    cout<    for(int i=0;i     {
     cout<<" Item code : ";
     cin>>s[i].itemcode;
     cout<<" Item name : ";
     gets(s[i].itemname);
     cout<<" Unit price of the item : ";
     cin>>s[i].unitprice;
     cout<     }
    cout<<"enter the item code of the item to be purchased : ";
    cin>>s1.itemcode;
    cout<<"enter the total quantity : ";
    cin>>s1.quantity;
    cout<
    for(i=0;i      {
      if (s[i].itemcode == s1.itemcode)
         {
         amt = s[i].unitprice * s1.quantity;
         clrscr();
         cout<<"\t B I L L "<<"\n\n";
         cout<<" item code  : "<         cout<<" item name  : "<         cout<<" unit price : "<         cout<<" quantity   : "<         cout<<"\n";
         cout<<" total amount  : "<         }
      else
        {
        clrscr();
        cout<<" THE ITEM IS NOT AVAILABLE ";
        }
      }
    getch();
    }

Posted Date: 10/22/2012 5:09:19 AM | Location : United States







Related Discussions:- Program to display stock containing item code, Assignment Help, Ask Question on Program to display stock containing item code, Get Answer, Expert's Help, Program to display stock containing item code Discussions

Write discussion on Program to display stock containing item code
Your posts are moderated
Related Questions
Create a pseudocode in getting Calendar Quarter. The program should identify which quarter falls the given date. Note: Consider the date format DDMMYYYY.


Can any constructor throw an exception? How to handle error while the constructor fails?

Q: however shouldn't I always use a printOn() method instead of a friend function? A: No. The usual cause people wish to always use a printOn() method instead of  a friend fu

C Program for FUNCTION OF COUNT THE INTEREST float si(float,float,float); void main() {           float p=0,r=0,n=0,k=0;           clrscr();           printf("E

Write a program in C to implement a FTP client that can interoperate with a default FTP server . The client should implement basic FTP commands GET PUT LIST DELE . GET -> to

What are header files? What are their uses? - Header files are also known as library files. - They carry two significant things: definitions and prototypes of functions bein

Project Description: I have a code that works different on 64 bit and 32 bit system. Code is relative to some crypt functions, similar, but not equal to: I have to move fr

Threaded binary tree: Consider the linked illustration of a binary tree 'T.  Approximately half of the entries is the pointer fields 'LEFT' and 'RIGHT' will have null elements. Th

Sorted directory - C++ program: Write a program in c to sorting a directory. int main( int argc, char *argv[] ) {     if( argc 3 )         {         cerr