Question

In: Computer Science

Using C++, develop a project that uses the various concepts you have learned over the course...

Using C++, develop a project that uses the various concepts you have learned over the course the term. The purpose of this project is to understand important data structures and learn how to implement them so that improve programming skills as well. Your final deliverable can be a program to do some type of useful computation. It can be a retail management system that keeps track of the daily delivery orders by customers; or a clinic reservation system that bookkeeps patient information and manages bookings. These are ideas to help you find a project, not to restrict you; in other words, if you want to do something substantial and interesting (and has the required features described below), but it does not strictly fall into one of these categories, you may still do that.

My subject is data structure

Your project must have each of the following features:

1) It must use an efficient algorithm for sorting or searching or both, for some aspect of the project.

2) It must involve a linked-list implementation (e.g., stack, queue, etc.).

3) It must involve an implement of the binary tree ADT using a linked-list

Help me!!!!

Solutions

Expert Solution

Please see if this works for your requirement

#include<iostream.h>
#include<conio.h>
const int m=20;
class dept
{   int amount[m],pris[m],k,a,b,amount1;
      int code,code1,cod[m],s,last;
    public:
       float price,price1;
       dept(void);
       void sell(void);
       void total_items(void);
       void add_old(void);
       void add_new(void);
       void show(void);
     };
    dept:: dept(void)
    { s=0;a=10;b=40;last=5;amount[0]=0;
    for(int k=0;k<last;k++)
    { s=s+1;b=b+10;
      cod[k]=s;
    amount[k]=a;
      pris[k]=b;
    }
     }
   void dept::add_old(void)
    { cout<<"\nEnter item code:";
      cin>>code1;
      cout<<"\nEnter item price:";
      cin>>price1;
     for(k=0;k<last;k++)
       { if(code1==cod[k])
    { a=a+1;
        amount[k]=a;
        pris[k]=price1;
    }
       //    else
    //cout<<"\nSorry..This item is not available.\n";
       }
      }
   void dept::add_new(void)
   {    cout<<"\nEnter item code:";
    cin>>code1;
    cout<<"\nEnter amount of that item:";
    cin>>amount1;
    cout<<"\nEnter item price:";
    cin>>price1;

    cod[last]=code1;
    amount[last]=amount1;
    pris[last]=price1;
    last++;
     }
    void dept::show(void)
     { for(k=0;k<last;k++)
    {
    cout<<"\nCODE:"<<cod[k]<<"\t";
    cout<<"\nAMOUNT:"<<amount[k]<<"\t";
    cout<<"\nPRICE:"<<pris[k]<<endl;
    }
    }
void dept::sell(void)
   {
    cout<<"\nEnter product code:\n";
    cin>>code;
    cout<<"\nEnter product price:\n";
    cin>>price;
    }
void dept::total_items(void)
   {
     cout<<"\n\nITEM CODE:"<<code<<"\n\nITEM PRICE:"<<price;
   }
int main()
{
     dept d[10];
     static int j=0;
     int x,i=0,p,s=0;
    clrscr();
    do{
       cout<<"\nENTER YOUR CHOICE:\n";
       cout<<"\n1. Show all stored items:";
       cout<<"\n2. Add an old item:";
       cout<<"\n3. Add a new item:";
       cout<<"\n4. Sell an item:";
       cout<<"\n5. Total sold:";
       cout<<"\n6. Show total items sold:";
       cout<<"\n7. Quit";

      cin>>x;
    switch(x)
    {   case 1: d[i].show();
            break;
        case 2: d[i].add_old();
            d[i].show();
            break;
        case 3: d[i].add_new();
            d[i].show();
            break;
        case 4: d[i].sell();
            i++,j++;
            break;
        case 5:{ cout<<"Total Sold:";
             s=0;

             for(p=0;p<j;p++)
             { s=s+d[p].price;
             }
             cout<<s;
             cout<<"TK.\n";
             }
             break;
        case 6: for(i=0;i<j;i++)
              { d[i].total_items();
               }
              break;
        case 7: break;
         }
         } while(x!=7);
          getch();
          return 0;
       }


Related Solutions

Using the concepts and techniques you have learned during this course include details and discussion as...
Using the concepts and techniques you have learned during this course include details and discussion as to frequency of occurrence, patterns of offending, patterns of victimization and enough supporting detail to inform a coordinated law enforcement response.
Using the various Object Oriented Programming concepts and skills learnt in this course, design and develop...
Using the various Object Oriented Programming concepts and skills learnt in this course, design and develop a Java Application to compute an individual student’s GPA and store the records in a database. The application should have two components i.e. The student and the course components. The following should be the minimal operations on the course component: – Set course information – Print course information – Show credit hours – Show course number The following should be the minimal operations on...
Using your client's information and what you have learned in this course, develop an investment policy...
Using your client's information and what you have learned in this course, develop an investment policy statement for your client, offer recommendations for the client's portfolio, and provide a justification for the recommendations presented. The policy statement should be 500-750 words and must include the following information: A detailed explanation of the investment policy statement, including the investment objectives for the portfolio, based on the unique needs and preferences of the client. Description of any investment constraints, liquidity needs, and...
Assignment Details Final Project Overview Throughout this course, you have learned various components of accounting. These...
Assignment Details Final Project Overview Throughout this course, you have learned various components of accounting. These components work hand-in-hand to create the accounting cycle – the process of recording, summarizing and reporting transactions. The final project will provide you the opportunity to apply the skills covered in this course through the completion of the accounting cycle. In addition, you will be able to demonstrate your understanding through analysis of the completed information. This project will be completed in two parts...
Assignment Details Final Project Overview Throughout this course, you have learned various components of accounting. These...
Assignment Details Final Project Overview Throughout this course, you have learned various components of accounting. These components work hand-in-hand to create the accounting cycle – the process of recording, summarizing and reporting transactions. The final project will provide you the opportunity to apply the skills covered in this course through the completion of the accounting cycle. In addition, you will be able to demonstrate your understanding through analysis of the completed information. This project will be completed in two parts...
What concepts have you learned in managerial accounting course? Specifically, how can you use these concepts...
What concepts have you learned in managerial accounting course? Specifically, how can you use these concepts in future courses and in your career?
Based on what you have learned in this course about the various taxes, their advantages and...
Based on what you have learned in this course about the various taxes, their advantages and their drawbacks, devise a tax system for a poor sub-Saharan country with no natural resources (oil & gas). In other words, what combination of taxes would you use to raise enough revenue to provide essential public services and yet not stall the country’s economic development? You must back up your choices with explanations.
What concepts have you learned in this managerial accounting course? Specifically, how can you use these...
What concepts have you learned in this managerial accounting course? Specifically, how can you use these concepts in future courses and in your career?
Financial Reporting III Choose two concepts (Consolidations and Partnership) you have learned in this course and...
Financial Reporting III Choose two concepts (Consolidations and Partnership) you have learned in this course and explain how you may use them in a future accounting position. Make sure you provide details to include how each concept will help you support the financial goals of the company you currently work for or will work for in the future. *Consolidations: -Subsequent to the Date of Acquisition -Ownership Patterns and Taxes *Partnership: -Formation and Operation -Termination and Liquidation In your reflection, include...
Using the various tools and concepts we have learned thus far, recreate the following three UI...
Using the various tools and concepts we have learned thus far, recreate the following three UI Elements. Exact measurements have not been given so that you may explore scaling and sizing. UI Element UI Element UI Element For some of the more complex shapes, it is best to break them down into simpler shapes. For example, a magnifying glass is really just a circle with a diagonal line. Purpose To understand how Illustrator is used to design UI Elements
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT