Thread: c++ code "need help"

  1. #1
    Registered User
    Join Date
    Dec 2011
    Posts
    6

    c++ code "need help"

    Hay everyone I need help
    I have project in subject programming languages about make one idea on two languages c and java .
    I have made it in java but I couldn't in c
    this is the code in java
    Code:
    // Link.cpp : Defines the entry point for the console application.
    //
    
    #include "stdafx.h"
    #include "stdafx.h"
    #include "iostream"
    #include "string"
    
    using namespace std;
    class node
    {
        public:
            int value;            
            string bookName;
            string status;
            node *next;          //pointer to next node 
            node *prev;          //pointer to previous node 
    };
    
    class dlist
    {
        public:
            node *front;       //pointer to front of list   
            node *back;        //pointer to back of list  
    
        dlist()
        {
            front=NULL;
            back=NULL;
        }
    
        void insertFront(node *value);             
        void insertBack(node *);
        void removeFront();
        void removeBack();
        void insertBefore(node *value,node *nodeB);
        void insertAfter(node *n,node *nodeA);
        void removeBefore(node *nodeB);
        void removeAfter(node *nodeA);
        void removeNode(node *newNode);
        void printDListFront();
        void printDListBack();
    
        node* findNode(int value){
            node *newNode;
            newNode=new node();
            newNode=front;
            while((newNode->value!=value)&&(newNode->next!=NULL)){
                newNode=newNode->next;
            }
            return newNode;
        }
    };
    
    //insert a node before nodeB
    void dlist::insertBefore(node *value,node *nodeB)    
    {
        node *newNode;
        newNode=new node();
        newNode->prev=nodeB->prev;
        newNode->next =nodeB;
        newNode->value =value->value;
        newNode->bookName=value->bookName;
        newNode->status=value->status;
    
        if(nodeB->prev==NULL)
        {
            this->front=newNode; 
        }
        nodeB->prev=newNode;
    }
    
    //insert a node before the front node 
    void dlist::insertFront (node *value)
    {
        node *newNode;
        if(this->front==NULL)
        {
            newNode=new node();
            this->front=newNode;
            this->back =newNode;
            newNode->prev=NULL;
            newNode->next=NULL;
            newNode->value=value->value;
            newNode->bookName=value->bookName;
            newNode->status=value->status;
        }
        else
        {
            insertBefore(value,this->front );
        }
    }
    
    //insert a node after  nodeB
    void dlist::insertAfter(node *n,node *nodeB)
    {
        node *newNode;
        newNode=new node();
        newNode->next= nodeB->next ;
        newNode->prev  =nodeB;
        newNode->value =n->value;
        newNode->bookName =n->bookName;
        newNode->status =n->status;
        if(nodeB->next==NULL)
        {
            this->back =newNode; 
        }
        nodeB->next=newNode;
    }
    //insert a node after the last node 
    void dlist::insertBack (node *value)
    {          
        if(this->back==NULL)
        {
            cout<<"insert at back";
            insertFront(value);
        }
        else
        {
            cout<<"insert at back";
            insertAfter(value,this->back  );
        }
    }
    
    
    //remove the front node 
    void dlist::removeFront ()
    {
        removeNode(this->front);
    }
    
    //remove a back node 
    void dlist::removeBack  ()
    {
        removeNode(this->back);
    }
    
    //remove before a node 
    void dlist::removeBefore(node *nodeB)
    {
        if(nodeB->prev==this->front)
        {
            this->front=nodeB;
            this->front->prev=NULL;
        }
        else
        {
            removeNode(nodeB->prev);
        }
    }
    
    //remove after a node 
    void dlist::removeAfter(node *nodeA)
    {
        if(nodeA->next==this->back)
        {
            this->back=nodeA;
            this->back->next=NULL;
        }
        else
        {
            removeNode(nodeA->next);
        }
    }
    
    //remove a perticular node 
    void dlist::removeNode(node *nodeToRemove)
    {
        if(nodeToRemove==this->front)
        {
            this->front=this->front->next;
            this->front->prev=NULL;
        }
        else if (nodeToRemove==this->back)
        {
            this->back=this->back->prev;
            this->back->next=NULL ;
        }
        else
        {
            nodeToRemove->prev->next=nodeToRemove->next;
            nodeToRemove->next->prev=nodeToRemove->prev;
        }
    }
    
    //Print the list from front 
    void dlist::printDListFront()
    {
        node* curr2;
        curr2= this->front;
    
        while(curr2!=NULL)
        {
            cout<<curr2->value<<"\t ";
            cout.width(45);
            cout<<curr2->bookName;
            cout<<"\t "<<curr2->status<<"\n";
            curr2=curr2->next;
        }
        cout<<endl;
    }
    
    
    void dlist::printDListBack()
    {
        node* curr2;
        curr2= this->back;
        
        while(curr2!=NULL)
        {
            cout<<curr2->value<<" "<<curr2->bookName<<" "<<curr2->status;
            curr2=curr2->prev;
        }
        cout<<endl;
    }
    
    void main()
    {
        int user,choice,id;
        node *newBook;
        newBook=new node();
        dlist *st ;
        st= new dlist();
        newBook->bookName="Algorithms and Complexity ";
        newBook->value=1;
        newBook->status="Available";
        st->insertBack(newBook);
        newBook->bookName="The Assembly Language Database ";
        newBook->value=2;
        newBook->status="Available";
        st->insertBack(newBook);
        newBook->bookName="C++ Coding Standard ";
        newBook->value=3;
        newBook->status="Available";
        st->insertBack(newBook);
        newBook->bookName="Introduction To OOP Using C++ ";
        newBook->value=4;
        newBook->status="Available";
        st->insertBack(newBook);
        newBook->bookName="CGI Programming on the World Wide Web";
        newBook->value=5;
        newBook->status="Available";
        st->insertBack(newBook);
        newBook->bookName="MySQL Reference Manual";
        newBook->value=6;
        newBook->status="Available";
        st->insertBack(newBook);
        newBook->bookName="Practical PHP Programming";
        newBook->value=7;
        newBook->status="Available";
        st->insertBack(newBook);
        newBook->bookName="Comparison of Different SQL Implementations";
        newBook->value=8;
        newBook->status="Available";
        st->insertBack(newBook);
        newBook->bookName="Introducing Visual Basic 2005 for Developers";
        newBook->value=9;
        newBook->status="Available";
        st->insertBack(newBook);
        newBook->bookName="Introduction To Structured Query Language ";
        newBook->value=10;
        newBook->status="Available";
        st->insertBack(newBook);
        
        cout<<"Welcome to the Library System...!\n\n"<<endl;
        cout<<"If you are a librarian press 1 or student&teacher press 2:\nif you want to exit press 0..\n"<<endl;
        cin>>user;
        while(user!=0){
            if(user==1){
                cout<<"Enter the number of your choice from the following:\n";
                cout<<"  1- show list of books.\n";
                cout<<"  2- Add new book.\n";
                cout<<"  3- Remove book from list.\n";
                cout<<"  4- Borrow book.\n";
                cout<<"  5- Return book.\n\n";
                cout<<"  0- Exit...\n\n";
                cin>>choice;
                while(choice!=0){
                    switch(choice){
                        case 1:
    
                            cout<<"BookID  \t Book Name  \t  Availability\n"<<endl;
                            cout<<"------------------------------------------------------\n"<<endl;
                            st->printDListFront();
                            break;
                        case 2:
                            cout<<"Enter Book Id:\n";
                            cin>>newBook->value;
                            cout<<"Enter Book Name:\n";
                            cin>>newBook->bookName;
                            newBook->status="Available";
                            st->insertAfter(newBook,st->findNode((newBook->value-1)));
                            break;
                        case 3:
                            cout<<"Enter Book's ID you want to remove\n\n";
                            cin>>id;
                            st->removeNode(st->findNode(id));
                            break;
                        case 4:
                            cout<<"Enter Id of the book:\n\n";
                            cin>>id;
                            if(st->findNode(id)->status=="Available"){
                                st->findNode(id)->status="Not Available";
                                cout<<"Done....\n\n";
                            }else
                                cout<<"Soory..the book you choosed is Not Available...\n\n";
                            break;
                        case 5:
                            cout<<"Enter Id of the book:\n\n";
                            cin>>id;
                            st->findNode(id)->status="Available";
                            cout<<"Done....\n\n";
                            break;
                        case 0:
                            choice=0;
                            break;
                    }
                    cout<<"Enter the number of your choice from the following:\n";
                    cout<<"  1- show list of books.\n";
                    cout<<"  2- Add new book.\n";
                    cout<<"  3- Remove book from list.\n";
                    cout<<"  4- Borrow book.\n";
                    cout<<"  5- Return book.\n\n";
                    cout<<"  0- Exit...\n\n";
                    cin>>choice;
                }
            }
            else if(user==2){
                cout<<"Enter the number of your choice from the following:\n";
                cout<<"  1- show list of books.\n";
                cout<<"  2- show book availability.\n";
                cout<<"  0- Exit...\n";
                cin>>choice;
                while(choice!=0){
    
                    switch(choice){
                        case 1:
                            cout<<"BookID  \t Book Name  \t  Availability\n"<<endl;
                            cout<<"------------------------------------------------------\n"<<endl;
                            st->printDListFront();
                            break;
                        case 2:
                            cout<<"Enter Id of the book:\n\n";
                            cin>>id;
                            cout<<"The book is "<<st->findNode(id)->status<<"...\n\n";
                            break;
                        case 0:
                            choice=0;
                            break;
                    }
                    cout<<"Enter the number of your choice from the following:\n";
                    cout<<"  1- show list of books.\n";
                    cout<<"  2- show book availability.\n";
                    cout<<"  0- Exit...\n";
                    cin>>choice;
                }
            }
        
        cout<<"Welcome to the Library System...!\n\n"<<endl;
        cout<<"If you are a librarian press 1 or student&teacher press 2:\nif you want to exit press 0..\n"<<endl;
        cin>>user;
        choice=0;
        }
    }
    and I did it on c++
    but the requirement in c not in c++
    could someone help me and make it in c or explain how I can make the change
    thanks for you

  2. #2
    Registered User
    Join Date
    Dec 2011
    Posts
    6
    plz help me anyone I will ever forget this is nice person all my life
    the submission of project next week

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    > I have made it in java but I couldn't in c
    > this is the code in java
    Really...

    > and I did it on c++
    Really....

    Because it looks like copy/paste from here - even down to random white space inserts all over the place.
    compiler errors - C++ XCODE need help Beginner Using - Stack Overflow
    Sure you've tarted up the intentation, and added a few bits.


    > but the requirement in c not in c++
    Perhaps you should have thought about that at the start....

    > the submission of project next week
    Before asking someone else to burn their Xmas while you go out and party.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  4. #4
    Registered User
    Join Date
    Dec 2011
    Posts
    6
    yes in c++ give me 26 error and i couldn't correct it
    and this is the code in java
    Code:
    Class Link
    // Link.java
    // to run this program: C>java Main
    //--------------------------------------------------------------
    class Link
       {
    public String bookName;              // data item
    publicintBookID;           // data item
    public String State;
    public Link next;              // next link in list
     
    // -------------------------------------------------------------
    public Link(String BN,intID,String state) // constructor
          {
    bookName= BN; 
    BookID = ID; 
            State=state;
          }                           //  set to null)
    // -------------------------------------------------------------
    public void displayLink()      // display ourself
          {
    System.out.print("" + BookID + " " + bookName +"\n ");
          }
    public void displaystate()      // display ourself
          { 
    System.out.print(" " + BookID + " " + bookName +"\t \t \t"+State+"\n ");
    System.out.println("--------------------------------------------------------------------------");     
          }  
    }  // end class Link
    ////////////////////////////////////////////////////////////////
     
    Class LinkList
    // linkList.java
    // demonstrates linked list
    // to run this program: C>java Main
    ////////////////////////////////////////////////////////////////
    classlinkList
       {
    private Link first; // ref to first link on list
    private Link last; 
    // -------------------------------------------------------------
    publiclinkList()              // constructor
          {
    first = null;               // no links on list yet
    last= null;
          }
    //---------------------------------------------------------------------------------
    public void insert(String BN,intID,String state)        // insert, in order
          {
           Link newLink = new Link(BN, ID,state);    // make new link
          Link previous = null;            // start at first
          Link current = first;
                                           // until end of list,
    while(current != null && ID >current.BookID)
             {                             // or key > current,
    previous = current;
    current = current.next;       // go to next item
             }
    if(previous==null)               // at beginning of list
    first = newLink;              // first -->newLink
    else                             // not at beginning
    previous.next = newLink;      // old prev -->newLink
    newLink.next = current;          // newLink --> old currnt
          } 
    // -------------------------------------------------------------
    public Link find(int key)      // find link with given key
          {                           // (assumes non-empty list)
          Link current = first;              // start at 'first'
    while(current.BookID != key)        // while no match,
             {
    if(current.next == null)        // if end of list,
    return null;                 // didn't find it
    else                            // not end of list,
    current = current.next;      // go to next link
             }
    return current;                    // found it
          }
    // -------------------------------------------------------------
    public Link delete(int key)    // delete link with given key
          {                           // (assumes non-empty list)
          Link current = first;              // search for link
          Link previous = first;
    while(current.BookID != key)
             {
    if(current.next == null)
    return null;                 // didn't find it
    else
                {
    previous = current;          // go to next link
    current = current.next;
                }
             }                               // found it
    if(current == first)               // if first link,
    first = first.next;             //    change first
    else                               // otherwise,
    previous.next = current.next;   //    bypass it
    return current;
          }
    // -------------------------------------------------------------
    public void displayList()
          {
    System.out.println("List of books:");
          Link current = first;       // start at beginning of list
    while(current != null)      // until end of list,
             {
    current.displayLink();   // print data
    current = current.next;  // move to next link
             }
    System.out.println("");
          }
    // -------------------------------------------------------------
    public void displayState(Link key)
          {
    System.out.println("state of books:");
    System.out.println(" ID              Book Name                                  State         ");
    System.out.print("-------------------------------------------------------------------------\n");
          Link current = first;       // start at beginning of list
    while(current != key)      // until end of list,
             {
    current = current.next;  // move to next link
             }
    current.displaystate();
    System.out.println("");
        }
    // -------------------------------------------------------------
    public void displayStateall(Link key)
          {
    System.out.println("list after EDIT:>");
    System.out.println("state of books:");
    System.out.println(" ID              Book Name                                  State         ");
    System.out.print("-----------------------------------------------------------------------\n");
          Link current = first;       // start at beginning of list
    while(current != null)      // until end of list,
             { 
    current.displaystate();
    current = current.next;  // move to next link     
             }  
    System.out.println("");}
    // -------------------------------------------------------------
    public Link seAv(int key)      
          {     
          Link current = first;       // start at beginning of list
    while(current.BookID != key)      // until end of list,
             {
    current = current.next;  // move to next link
             }
    if(current.State=="Available")
             {
    current.State="Not Avaliable";
    current.displaystate();
             }
    else{
    current.State="Not Avaliable";
    current.displaystate();}
     
    System.out.println("");
    return current;}
    //---------------------------------------------------------------      
    public Link seNAv(int key)      
          {   
          Link current = first;       // start at beginning of list
    while(current.BookID != key)      // until end of list,
             {
    current = current.next;  // move to next link
             }
    if(current.State=="Not Available")
             { 
    current.State="Avaliable";
    current.displaystate();
             }
    else
       {
    current.State="Avaliable";
    current.displaystate();
        }
     
    System.out.println("");
    return current;
    }//end seNAv
    }//end class linkList
    
     
     
    Class Main
     
     
     
     
     
     
    //Data Structure project-YUC
    //Electronic Quick Library System
    //programmed by :Wafaalshaikh&WijdanAljohani
    //-------------------------------------------------------------------------------------Backages
    importjava.awt.Component;
    importjava.awt.FlowLayout;
    importjava.awt.HeadlessException;
    importjava.awt.event.ActionEvent;
    importjava.awt.event.ActionListener;
    importjavax.swing.JButton;
    importjavax.swing.JFrame;
    importjavax.swing.JOptionPane;
    importjavax.swing.JPanel;
    importjava.util.*;
    importjava.util.Scanner;
    importjava.awt.*;
    importjava.awt.event.*;
    importjavax.swing.*;
    importjavax.swing.border.*; 
    importjava.text.*;
    importjava.util.Scanner;
    importjavax.swing.JOptionPane;
    //--------------------------------------------------------------------------------------Class Main
    public class Main extends JFrame
    {     
    //-----------------------------------------------------------------------------------1--Method main  
    public static void main(String[] args)
      {   
    new Main().setVisible(true);//call method Main   
      }//end public static void main
    //----------------------------------------------------------------------------------2--Mathod Main
    public Main() 
      {
    finallinkListtheList = new linkList();
    final Scanner input = new Scanner(System.in);
          ////////////////////////////
    theList.insert("Algorithms and Complexity ", 1,"Available");      // insert 10 books
    theList.insert("The Assembly Language Database ", 2,"Available");
    theList.insert("C++ Coding Standard ", 3,"Available");
    theList.insert("Introduction To OOP Using C++ ",4,"Available");
    theList.insert("CGI Programming on the World Wide Web",5,"Available");
    theList.insert("MySQL Reference Manual",6,"Available");
    theList.insert("Practical PHP Programming",7,"Available");
    theList.insert("Comparison of Different SQL Implementations",8,"Available");
    theList.insert("Introducing Visual Basic 2005 for Developers",9,"Available");
    theList.insert("Introduction To Structured Query Language  ",10,"Available");
         /////////////////
    setTitle("EQLS");
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    //---------------------------------------------------------------------------Date-Photo-size-color
             Date da = new Date();
             Container contentPane = getContentPane();
    contentPane.setLayout(new BorderLayout());
    contentPane.setBackground(Color.orange);
    setSize(600, 600);
             //-------------------
    JLabel time = new JLabel("Today is:" +da);
    getContentPane().add(time);
             //----------------
    setResizable(false);                       
    setLocationRelativeTo(null);         
             String imgStr1 = "c://EQLS.png";
    ImageIcon image = new ImageIcon(imgStr1);     
    JLabel label1 = new JLabel(" ", image, JLabel.CENTER);
    getContentPane().add(label1);
    validate();  
    setVisible(true);
             //------------------
     
    //-----------------------------------------------------------------------------------------Button1
    JButton button1 = new JButton("Welcom to [ Electronic Quick Library System ]");
    button1.addActionListener(new ActionListener() {   public void actionPerformed(ActionEvent e) 
          {
    JOptionPane.showMessageDialog((Component) e.getSource(), "\n\n EQLS: [ Electronic Quick Library System ] \n\n [ System provides a quick services for books to student and teachers in Yanbu Uneversiy College ] \n\n [ Programmed by: Wijdan Al-Johani& Wafa'a Al-Shaikh ]\n\n [ This system is a project of Data Structure Subject ]\n\n [ 2001 ]\n\n");
           }
        });//end button1
    //-----------------------------------------------------------------------------------------Button2
    JButton button2 = new JButton("Main User Access: Librarian");
    button2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e)
          { 
              String Option1 = JOptionPane.showInputDialog(null,"\n1-Show List of bookes\n2-Add new book\n3-Remove book from list\n4-Borrow\n5-Return\n6-Exit\n\nEnter a number of service", "Librarian Options", JOptionPane.INFORMATION_MESSAGE);
    int ConvOption1 = Integer.parseInt(Option1);
    while(ConvOption1!=6)
        {
    switch (ConvOption1)
           {
    case 1:{
    theList.displayList();
                  }
    break;
    case 2:{
                  String name = JOptionPane.showInputDialog((Component) e.getSource(), "Enter Name of the Book:");
                  String num = JOptionPane.showInputDialog((Component) e.getSource(), "Enter Number of the Book:");
    intConvNum = Integer.parseInt(num);
    theList.insert(name,ConvNum,"Available");
                }
    break;
    case 3:{
                String num = JOptionPane.showInputDialog((Component) e.getSource(), "Enter Number of the Book:");
    intConvNum = Integer.parseInt(num);
                Link d = theList.delete(ConvNum);        // delete item
    if( d != null )
    JOptionPane.showMessageDialog((Component) e.getSource(), "Deleted the book with number " + d.BookID);
    else
    JOptionPane.showMessageDialog((Component) e.getSource(),"Book is not in the list to delete");
    theList.displayList(); 
                 } 
    break;
    case 4:{
    theList.displayList();
                  String num = JOptionPane.showInputDialog((Component) e.getSource(), "Enter Book Nember:>");
    intConvNum = Integer.parseInt(num);
                  Link v = theList.seAv(ConvNum);
    theList.displayStateall(v);
                 }
    break;
    case 5:{ 
    theList.displayList();
                  String num = JOptionPane.showInputDialog((Component) e.getSource(), "Enter Book Nember:>");
    intConvNum = Integer.parseInt(num);
                  Link v = theList.seNAv(ConvNum);
    theList.displayStateall(v);
                  }
       }//end switch
     
         Option1 = JOptionPane.showInputDialog("\n1-Show List of bookes\n2-Add new book\n3-Remove book from list\n4-Borrow\n5-Return\n6-Exit");
         ConvOption1 = Integer.parseInt(Option1);
     
        }//end while
          }//end method public void actionListener
        });//end button2
    //-----------------------------------------------------------------------------------------Button3        
    JButton button3 = new JButton("Sub Users Access: Students & Teachers");   
    button3.addActionListener(new ActionListener() {public void actionPerformed(ActionEvent e)
          {
               String Option2 = JOptionPane.showInputDialog(null, "\n1-Show list of bookes\n2-Search book\n3-Exit\n\nEnter a number of service", "Sub-Users Options", JOptionPane.INFORMATION_MESSAGE);
    int ConvOption2 = Integer.parseInt(Option2);
    while(ConvOption2!=3)
          {
    switch (ConvOption2)
           {
    case 1:{
    theList.displayList();
                }
    break;
    case 2:{
                  String key = JOptionPane.showInputDialog((Component) e.getSource(), "Enter Book Number:");
    intConvkey = Integer.parseInt(key);
                  Link f = theList.find(Convkey);          // find item
    if( f != null)
                    {         
    theList.displayState(f);
                    }
    else
    JOptionPane.showMessageDialog((Component) e.getSource(), "Can't find The book of number" + Convkey);
                  }
    break;
            }//end switch
          Option2 = JOptionPane.showInputDialog(null, "\n1-Show list of bookes\n2-Search book\n3-Exit\n\nEnter a number of service", "Sub-Users Options", JOptionPane.INFORMATION_MESSAGE);
          ConvOption2 = Integer.parseInt(Option2);
         }//end while
        }//end method public void actionListener
    });//end button3 
     
    //------------------------------------------------------------------------------------------Button4
    JButton button4 = new JButton("Exit");
    button4.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e)
          {
    int result = JOptionPane.showConfirmDialog((Component) e.getSource(),"Close EQLS ");
    if (result == JOptionPane.YES_OPTION)
            {System.exit(0);} 
          }
        });//end button3
    //------------------------------------------------------------------------------------------
    setLayout(new FlowLayout(FlowLayout.CENTER));
    setLayout(new GridLayout(4,2));
    getContentPane().add(button1);
    getContentPane().add(button2);
    getContentPane().add(button3);
    getContentPane().add(button4);
      }//end public method Main
    ////////////////////////////////////////////////////////////////////////////////////
    }//end class Main
     
     
     
    Class Link
    // Link.java
    // to run this program: C>java Main
    //--------------------------------------------------------------
    class Link
       {
    public String bookName;              // data item
    publicintBookID;           // data item
    public String State;
    public Link next;              // next link in list
     
    // -------------------------------------------------------------
    public Link(String BN,intID,String state) // constructor
          {
    bookName= BN; 
    BookID = ID; 
            State=state;
          }                           //  set to null)
    // -------------------------------------------------------------
    public void displayLink()      // display ourself
          {
    System.out.print("" + BookID + " " + bookName +"\n ");
          }
    public void displaystate()      // display ourself
          { 
    System.out.print(" " + BookID + " " + bookName +"\t \t \t"+State+"\n ");
    System.out.println("--------------------------------------------------------------------------");     
          }  
    }  // end class Link
    ////////////////////////////////////////////////////////////////
     
    Class LinkList
    // linkList.java
    // demonstrates linked list
    // to run this program: C>java Main
    ////////////////////////////////////////////////////////////////
    classlinkList
       {
    private Link first; // ref to first link on list
    private Link last; 
    // -------------------------------------------------------------
    publiclinkList()              // constructor
          {
    first = null;               // no links on list yet
    last= null;
          }
    //---------------------------------------------------------------------------------
    public void insert(String BN,intID,String state)        // insert, in order
          {
           Link newLink = new Link(BN, ID,state);    // make new link
          Link previous = null;            // start at first
          Link current = first;
                                           // until end of list,
    while(current != null && ID >current.BookID)
             {                             // or key > current,
    previous = current;
    current = current.next;       // go to next item
             }
    if(previous==null)               // at beginning of list
    first = newLink;              // first -->newLink
    else                             // not at beginning
    previous.next = newLink;      // old prev -->newLink
    newLink.next = current;          // newLink --> old currnt
          } 
    // -------------------------------------------------------------
    public Link find(int key)      // find link with given key
          {                           // (assumes non-empty list)
          Link current = first;              // start at 'first'
    while(current.BookID != key)        // while no match,
             {
    if(current.next == null)        // if end of list,
    return null;                 // didn't find it
    else                            // not end of list,
    current = current.next;      // go to next link
             }
    return current;                    // found it
          }
    // -------------------------------------------------------------
    public Link delete(int key)    // delete link with given key
          {                           // (assumes non-empty list)
          Link current = first;              // search for link
          Link previous = first;
    while(current.BookID != key)
             {
    if(current.next == null)
    return null;                 // didn't find it
    else
                {
    previous = current;          // go to next link
    current = current.next;
                }
             }                               // found it
    if(current == first)               // if first link,
    first = first.next;             //    change first
    else                               // otherwise,
    previous.next = current.next;   //    bypass it
    return current;
          }
    // -------------------------------------------------------------
    public void displayList()
          {
    System.out.println("List of books:");
          Link current = first;       // start at beginning of list
    while(current != null)      // until end of list,
             {
    current.displayLink();   // print data
    current = current.next;  // move to next link
             }
    System.out.println("");
          }
    // -------------------------------------------------------------
    public void displayState(Link key)
          {
    System.out.println("state of books:");
    System.out.println(" ID              Book Name                                  State         ");
    System.out.print("-------------------------------------------------------------------------\n");
          Link current = first;       // start at beginning of list
    while(current != key)      // until end of list,
             {
    current = current.next;  // move to next link
             }
    current.displaystate();
    System.out.println("");
        }
    // -------------------------------------------------------------
    public void displayStateall(Link key)
          {
    System.out.println("list after EDIT:>");
    System.out.println("state of books:");
    System.out.println(" ID              Book Name                                  State         ");
    System.out.print("-----------------------------------------------------------------------\n");
          Link current = first;       // start at beginning of list
    while(current != null)      // until end of list,
             { 
    current.displaystate();
    current = current.next;  // move to next link     
             }  
    System.out.println("");}
    // -------------------------------------------------------------
    public Link seAv(int key)      
          {     
          Link current = first;       // start at beginning of list
    while(current.BookID != key)      // until end of list,
             {
    current = current.next;  // move to next link
             }
    if(current.State=="Available")
             {
    current.State="Not Avaliable";
    current.displaystate();
             }
    else{
    current.State="Not Avaliable";
    current.displaystate();}
     
    System.out.println("");
    return current;}
    //---------------------------------------------------------------      
    public Link seNAv(int key)      
          {   
          Link current = first;       // start at beginning of list
    while(current.BookID != key)      // until end of list,
             {
    current = current.next;  // move to next link
             }
    if(current.State=="Not Available")
             { 
    current.State="Avaliable";
    current.displaystate();
             }
    else
       {
    current.State="Avaliable";
    current.displaystate();
        }
     
    System.out.println("");
    return current;
    }//end seNAv
    }//end class linkList
    
     
     
    Class Main
     
     
     
     
     
     
    //Data Structure project-YUC
    //Electronic Quick Library System
    //programmed by :Wafaalshaikh&WijdanAljohani
    //-------------------------------------------------------------------------------------Backages
    importjava.awt.Component;
    importjava.awt.FlowLayout;
    importjava.awt.HeadlessException;
    importjava.awt.event.ActionEvent;
    importjava.awt.event.ActionListener;
    importjavax.swing.JButton;
    importjavax.swing.JFrame;
    importjavax.swing.JOptionPane;
    importjavax.swing.JPanel;
    importjava.util.*;
    importjava.util.Scanner;
    importjava.awt.*;
    importjava.awt.event.*;
    importjavax.swing.*;
    importjavax.swing.border.*; 
    importjava.text.*;
    importjava.util.Scanner;
    importjavax.swing.JOptionPane;
    //--------------------------------------------------------------------------------------Class Main
    public class Main extends JFrame
    {     
    //-----------------------------------------------------------------------------------1--Method main  
    public static void main(String[] args)
      {   
    new Main().setVisible(true);//call method Main   
      }//end public static void main
    //----------------------------------------------------------------------------------2--Mathod Main
    public Main() 
      {
    finallinkListtheList = new linkList();
    final Scanner input = new Scanner(System.in);
          ////////////////////////////
    theList.insert("Algorithms and Complexity ", 1,"Available");      // insert 10 books
    theList.insert("The Assembly Language Database ", 2,"Available");
    theList.insert("C++ Coding Standard ", 3,"Available");
    theList.insert("Introduction To OOP Using C++ ",4,"Available");
    theList.insert("CGI Programming on the World Wide Web",5,"Available");
    theList.insert("MySQL Reference Manual",6,"Available");
    theList.insert("Practical PHP Programming",7,"Available");
    theList.insert("Comparison of Different SQL Implementations",8,"Available");
    theList.insert("Introducing Visual Basic 2005 for Developers",9,"Available");
    theList.insert("Introduction To Structured Query Language  ",10,"Available");
         /////////////////
    setTitle("EQLS");
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    //---------------------------------------------------------------------------Date-Photo-size-color
             Date da = new Date();
             Container contentPane = getContentPane();
    contentPane.setLayout(new BorderLayout());
    contentPane.setBackground(Color.orange);
    setSize(600, 600);
             //-------------------
    JLabel time = new JLabel("Today is:" +da);
    getContentPane().add(time);
             //----------------
    setResizable(false);                       
    setLocationRelativeTo(null);         
             String imgStr1 = "c://EQLS.png";
    ImageIcon image = new ImageIcon(imgStr1);     
    JLabel label1 = new JLabel(" ", image, JLabel.CENTER);
    getContentPane().add(label1);
    validate();  
    setVisible(true);
             //------------------
     
    //-----------------------------------------------------------------------------------------Button1
    JButton button1 = new JButton("Welcom to [ Electronic Quick Library System ]");
    button1.addActionListener(new ActionListener() {   public void actionPerformed(ActionEvent e) 
          {
    JOptionPane.showMessageDialog((Component) e.getSource(), "\n\n EQLS: [ Electronic Quick Library System ] \n\n [ System provides a quick services for books to student and teachers in Yanbu Uneversiy College ] \n\n [ Programmed by: Wijdan Al-Johani& Wafa'a Al-Shaikh ]\n\n [ This system is a project of Data Structure Subject ]\n\n [ 2001 ]\n\n");
           }
        });//end button1
    //-----------------------------------------------------------------------------------------Button2
    JButton button2 = new JButton("Main User Access: Librarian");
    button2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e)
          { 
              String Option1 = JOptionPane.showInputDialog(null,"\n1-Show List of bookes\n2-Add new book\n3-Remove book from list\n4-Borrow\n5-Return\n6-Exit\n\nEnter a number of service", "Librarian Options", JOptionPane.INFORMATION_MESSAGE);
    int ConvOption1 = Integer.parseInt(Option1);
    while(ConvOption1!=6)
        {
    switch (ConvOption1)
           {
    case 1:{
    theList.displayList();
                  }
    break;
    case 2:{
                  String name = JOptionPane.showInputDialog((Component) e.getSource(), "Enter Name of the Book:");
                  String num = JOptionPane.showInputDialog((Component) e.getSource(), "Enter Number of the Book:");
    intConvNum = Integer.parseInt(num);
    theList.insert(name,ConvNum,"Available");
                }
    break;
    case 3:{
                String num = JOptionPane.showInputDialog((Component) e.getSource(), "Enter Number of the Book:");
    intConvNum = Integer.parseInt(num);
                Link d = theList.delete(ConvNum);        // delete item
    if( d != null )
    JOptionPane.showMessageDialog((Component) e.getSource(), "Deleted the book with number " + d.BookID);
    else
    JOptionPane.showMessageDialog((Component) e.getSource(),"Book is not in the list to delete");
    theList.displayList(); 
                 } 
    break;
    case 4:{
    theList.displayList();
                  String num = JOptionPane.showInputDialog((Component) e.getSource(), "Enter Book Nember:>");
    intConvNum = Integer.parseInt(num);
                  Link v = theList.seAv(ConvNum);
    theList.displayStateall(v);
                 }
    break;
    case 5:{ 
    theList.displayList();
                  String num = JOptionPane.showInputDialog((Component) e.getSource(), "Enter Book Nember:>");
    intConvNum = Integer.parseInt(num);
                  Link v = theList.seNAv(ConvNum);
    theList.displayStateall(v);
                  }
       }//end switch
     
         Option1 = JOptionPane.showInputDialog("\n1-Show List of bookes\n2-Add new book\n3-Remove book from list\n4-Borrow\n5-Return\n6-Exit");
         ConvOption1 = Integer.parseInt(Option1);
     
        }//end while
          }//end method public void actionListener
        });//end button2
    //-----------------------------------------------------------------------------------------Button3        
    JButton button3 = new JButton("Sub Users Access: Students & Teachers");   
    button3.addActionListener(new ActionListener() {public void actionPerformed(ActionEvent e)
          {
               String Option2 = JOptionPane.showInputDialog(null, "\n1-Show list of bookes\n2-Search book\n3-Exit\n\nEnter a number of service", "Sub-Users Options", JOptionPane.INFORMATION_MESSAGE);
    int ConvOption2 = Integer.parseInt(Option2);
    while(ConvOption2!=3)
          {
    switch (ConvOption2)
           {
    case 1:{
    theList.displayList();
                }
    break;
    case 2:{
                  String key = JOptionPane.showInputDialog((Component) e.getSource(), "Enter Book Number:");
    intConvkey = Integer.parseInt(key);
                  Link f = theList.find(Convkey);          // find item
    if( f != null)
                    {         
    theList.displayState(f);
                    }
    else
    JOptionPane.showMessageDialog((Component) e.getSource(), "Can't find The book of number" + Convkey);
                  }
    break;
            }//end switch
          Option2 = JOptionPane.showInputDialog(null, "\n1-Show list of bookes\n2-Search book\n3-Exit\n\nEnter a number of service", "Sub-Users Options", JOptionPane.INFORMATION_MESSAGE);
          ConvOption2 = Integer.parseInt(Option2);
         }//end while
        }//end method public void actionListener
    });//end button3 
     
    //------------------------------------------------------------------------------------------Button4
    JButton button4 = new JButton("Exit");
    button4.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e)
          {
    int result = JOptionPane.showConfirmDialog((Component) e.getSource(),"Close EQLS ");
    if (result == JOptionPane.YES_OPTION)
            {System.exit(0);} 
          }
        });//end button3
    //------------------------------------------------------------------------------------------
    setLayout(new FlowLayout(FlowLayout.CENTER));
    setLayout(new GridLayout(4,2));
    getContentPane().add(button1);
    getContentPane().add(button2);
    getContentPane().add(button3);
    getContentPane().add(button4);
      }//end public method Main
    ////////////////////////////////////////////////////////////////////////////////////
    }//end class Main
     
     
     
    Class Link
    // Link.java
    // to run this program: C>java Main
    //--------------------------------------------------------------
    class Link
       {
    public String bookName;              // data item
    publicintBookID;           // data item
    public String State;
    public Link next;              // next link in list
     
    // -------------------------------------------------------------
    public Link(String BN,intID,String state) // constructor
          {
    bookName= BN; 
    BookID = ID; 
            State=state;
          }                           //  set to null)
    // -------------------------------------------------------------
    public void displayLink()      // display ourself
          {
    System.out.print("" + BookID + " " + bookName +"\n ");
          }
    public void displaystate()      // display ourself
          { 
    System.out.print(" " + BookID + " " + bookName +"\t \t \t"+State+"\n ");
    System.out.println("--------------------------------------------------------------------------");     
          }  
    }  // end class Link
    ////////////////////////////////////////////////////////////////
     
    Class LinkList
    // linkList.java
    // demonstrates linked list
    // to run this program: C>java Main
    ////////////////////////////////////////////////////////////////
    classlinkList
       {
    private Link first; // ref to first link on list
    private Link last; 
    // -------------------------------------------------------------
    publiclinkList()              // constructor
          {
    first = null;               // no links on list yet
    last= null;
          }
    //---------------------------------------------------------------------------------
    public void insert(String BN,intID,String state)        // insert, in order
          {
           Link newLink = new Link(BN, ID,state);    // make new link
          Link previous = null;            // start at first
          Link current = first;
                                           // until end of list,
    while(current != null && ID >current.BookID)
             {                             // or key > current,
    previous = current;
    current = current.next;       // go to next item
             }
    if(previous==null)               // at beginning of list
    first = newLink;              // first -->newLink
    else                             // not at beginning
    previous.next = newLink;      // old prev -->newLink
    newLink.next = current;          // newLink --> old currnt
          } 
    // -------------------------------------------------------------
    public Link find(int key)      // find link with given key
          {                           // (assumes non-empty list)
          Link current = first;              // start at 'first'
    while(current.BookID != key)        // while no match,
             {
    if(current.next == null)        // if end of list,
    return null;                 // didn't find it
    else                            // not end of list,
    current = current.next;      // go to next link
             }
    return current;                    // found it
          }
    // -------------------------------------------------------------
    public Link delete(int key)    // delete link with given key
          {                           // (assumes non-empty list)
          Link current = first;              // search for link
          Link previous = first;
    while(current.BookID != key)
             {
    if(current.next == null)
    return null;                 // didn't find it
    else
                {
    previous = current;          // go to next link
    current = current.next;
                }
             }                               // found it
    if(current == first)               // if first link,
    first = first.next;             //    change first
    else                               // otherwise,
    previous.next = current.next;   //    bypass it
    return current;
          }
    // -------------------------------------------------------------
    public void displayList()
          {
    System.out.println("List of books:");
          Link current = first;       // start at beginning of list
    while(current != null)      // until end of list,
             {
    current.displayLink();   // print data
    current = current.next;  // move to next link
             }
    System.out.println("");
          }
    // -------------------------------------------------------------
    public void displayState(Link key)
          {
    System.out.println("state of books:");
    System.out.println(" ID              Book Name                                  State         ");
    System.out.print("-------------------------------------------------------------------------\n");
          Link current = first;       // start at beginning of list
    while(current != key)      // until end of list,
             {
    current = current.next;  // move to next link
             }
    current.displaystate();
    System.out.println("");
        }
    // -------------------------------------------------------------
    public void displayStateall(Link key)
          {
    System.out.println("list after EDIT:>");
    System.out.println("state of books:");
    System.out.println(" ID              Book Name                                  State         ");
    System.out.print("-----------------------------------------------------------------------\n");
          Link current = first;       // start at beginning of list
    while(current != null)      // until end of list,
             { 
    current.displaystate();
    current = current.next;  // move to next link     
             }  
    System.out.println("");}
    // -------------------------------------------------------------
    public Link seAv(int key)      
          {     
          Link current = first;       // start at beginning of list
    while(current.BookID != key)      // until end of list,
             {
    current = current.next;  // move to next link
             }
    if(current.State=="Available")
             {
    current.State="Not Avaliable";
    current.displaystate();
             }
    else{
    current.State="Not Avaliable";
    current.displaystate();}
     
    System.out.println("");
    return current;}
    //---------------------------------------------------------------      
    public Link seNAv(int key)      
          {   
          Link current = first;       // start at beginning of list
    while(current.BookID != key)      // until end of list,
             {
    current = current.next;  // move to next link
             }
    if(current.State=="Not Available")
             { 
    current.State="Avaliable";
    current.displaystate();
             }
    else
       {
    current.State="Avaliable";
    current.displaystate();
        }
     
    System.out.println("");
    return current;
    }//end seNAv
    }//end class linkList
    
     
     
    Class Main
     
     
     
     
     
     
    //Data Structure project-YUC
    //Electronic Quick Library System
    //programmed by :Wafaalshaikh&WijdanAljohani
    //-------------------------------------------------------------------------------------Backages
    importjava.awt.Component;
    importjava.awt.FlowLayout;
    importjava.awt.HeadlessException;
    importjava.awt.event.ActionEvent;
    importjava.awt.event.ActionListener;
    importjavax.swing.JButton;
    importjavax.swing.JFrame;
    importjavax.swing.JOptionPane;
    importjavax.swing.JPanel;
    importjava.util.*;
    importjava.util.Scanner;
    importjava.awt.*;
    importjava.awt.event.*;
    importjavax.swing.*;
    importjavax.swing.border.*; 
    importjava.text.*;
    importjava.util.Scanner;
    importjavax.swing.JOptionPane;
    //--------------------------------------------------------------------------------------Class Main
    public class Main extends JFrame
    {     
    //-----------------------------------------------------------------------------------1--Method main  
    public static void main(String[] args)
      {   
    new Main().setVisible(true);//call method Main   
      }//end public static void main
    //----------------------------------------------------------------------------------2--Mathod Main
    public Main() 
      {
    finallinkListtheList = new linkList();
    final Scanner input = new Scanner(System.in);
          ////////////////////////////
    theList.insert("Algorithms and Complexity ", 1,"Available");      // insert 10 books
    theList.insert("The Assembly Language Database ", 2,"Available");
    theList.insert("C++ Coding Standard ", 3,"Available");
    theList.insert("Introduction To OOP Using C++ ",4,"Available");
    theList.insert("CGI Programming on the World Wide Web",5,"Available");
    theList.insert("MySQL Reference Manual",6,"Available");
    theList.insert("Practical PHP Programming",7,"Available");
    theList.insert("Comparison of Different SQL Implementations",8,"Available");
    theList.insert("Introducing Visual Basic 2005 for Developers",9,"Available");
    theList.insert("Introduction To Structured Query Language  ",10,"Available");
         /////////////////
    setTitle("EQLS");
    setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    //---------------------------------------------------------------------------Date-Photo-size-color
             Date da = new Date();
             Container contentPane = getContentPane();
    contentPane.setLayout(new BorderLayout());
    contentPane.setBackground(Color.orange);
    setSize(600, 600);
             //-------------------
    JLabel time = new JLabel("Today is:" +da);
    getContentPane().add(time);
             //----------------
    setResizable(false);                       
    setLocationRelativeTo(null);         
             String imgStr1 = "c://EQLS.png";
    ImageIcon image = new ImageIcon(imgStr1);     
    JLabel label1 = new JLabel(" ", image, JLabel.CENTER);
    getContentPane().add(label1);
    validate();  
    setVisible(true);
             //------------------
     
    //-----------------------------------------------------------------------------------------Button1
    JButton button1 = new JButton("Welcom to [ Electronic Quick Library System ]");
    button1.addActionListener(new ActionListener() {   public void actionPerformed(ActionEvent e) 
          {
    JOptionPane.showMessageDialog((Component) e.getSource(), "\n\n EQLS: [ Electronic Quick Library System ] \n\n [ System provides a quick services for books to student and teachers in Yanbu Uneversiy College ] \n\n [ Programmed by: Wijdan Al-Johani& Wafa'a Al-Shaikh ]\n\n [ This system is a project of Data Structure Subject ]\n\n [ 2001 ]\n\n");
           }
        });//end button1
    //-----------------------------------------------------------------------------------------Button2
    JButton button2 = new JButton("Main User Access: Librarian");
    button2.addActionListener(new ActionListener() { public void actionPerformed(ActionEvent e)
          { 
              String Option1 = JOptionPane.showInputDialog(null,"\n1-Show List of bookes\n2-Add new book\n3-Remove book from list\n4-Borrow\n5-Return\n6-Exit\n\nEnter a number of service", "Librarian Options", JOptionPane.INFORMATION_MESSAGE);
    int ConvOption1 = Integer.parseInt(Option1);
    while(ConvOption1!=6)
        {
    switch (ConvOption1)
           {
    case 1:{
    theList.displayList();
                  }
    break;
    case 2:{
                  String name = JOptionPane.showInputDialog((Component) e.getSource(), "Enter Name of the Book:");
                  String num = JOptionPane.showInputDialog((Component) e.getSource(), "Enter Number of the Book:");
    intConvNum = Integer.parseInt(num);
    theList.insert(name,ConvNum,"Available");
                }
    break;
    case 3:{
                String num = JOptionPane.showInputDialog((Component) e.getSource(), "Enter Number of the Book:");
    intConvNum = Integer.parseInt(num);
                Link d = theList.delete(ConvNum);        // delete item
    if( d != null )
    JOptionPane.showMessageDialog((Component) e.getSource(), "Deleted the book with number " + d.BookID);
    else
    JOptionPane.showMessageDialog((Component) e.getSource(),"Book is not in the list to delete");
    theList.displayList(); 
                 } 
    break;
    case 4:{
    theList.displayList();
                  String num = JOptionPane.showInputDialog((Component) e.getSource(), "Enter Book Nember:>");
    intConvNum = Integer.parseInt(num);
                  Link v = theList.seAv(ConvNum);
    theList.displayStateall(v);
                 }
    break;
    case 5:{ 
    theList.displayList();
                  String num = JOptionPane.showInputDialog((Component) e.getSource(), "Enter Book Nember:>");
    intConvNum = Integer.parseInt(num);
                  Link v = theList.seNAv(ConvNum);
    theList.displayStateall(v);
                  }
       }//end switch
     
         Option1 = JOptionPane.showInputDialog("\n1-Show List of bookes\n2-Add new book\n3-Remove book from list\n4-Borrow\n5-Return\n6-Exit");
         ConvOption1 = Integer.parseInt(Option1);
     
        }//end while
          }//end method public void actionListener
        });//end button2
    //-----------------------------------------------------------------------------------------Button3        
    JButton button3 = new JButton("Sub Users Access: Students & Teachers");   
    button3.addActionListener(new ActionListener() {public void actionPerformed(ActionEvent e)
          {
               String Option2 = JOptionPane.showInputDialog(null, "\n1-Show list of bookes\n2-Search book\n3-Exit\n\nEnter a number of service", "Sub-Users Options", JOptionPane.INFORMATION_MESSAGE);
    int ConvOption2 = Integer.parseInt(Option2);
    while(ConvOption2!=3)
          {
    switch (ConvOption2)
           {
    case 1:{
    theList.displayList();
                }
    break;
    case 2:{
                  String key = JOptionPane.showInputDialog((Component) e.getSource(), "Enter Book Number:");
    intConvkey = Integer.parseInt(key);
                  Link f = theList.find(Convkey);          // find item
    if( f != null)
                    {         
    theList.displayState(f);
                    }
    else
    JOptionPane.showMessageDialog((Component) e.getSource(), "Can't find The book of number" + Convkey);
                  }
    break;
            }//end switch
          Option2 = JOptionPane.showInputDialog(null, "\n1-Show list of bookes\n2-Search book\n3-Exit\n\nEnter a number of service", "Sub-Users Options", JOptionPane.INFORMATION_MESSAGE);
          ConvOption2 = Integer.parseInt(Option2);
         }//end while
        }//end method public void actionListener
    });//end button3 
     
    //------------------------------------------------------------------------------------------Button4
    JButton button4 = new JButton("Exit");
    button4.addActionListener(new ActionListener(){ public void actionPerformed(ActionEvent e)
          {
    int result = JOptionPane.showConfirmDialog((Component) e.getSource(),"Close EQLS ");
    if (result == JOptionPane.YES_OPTION)
            {System.exit(0);} 
          }
        });//end button3
    //------------------------------------------------------------------------------------------
    setLayout(new FlowLayout(FlowLayout.CENTER));
    setLayout(new GridLayout(4,2));
    getContentPane().add(button1);
    getContentPane().add(button2);
    getContentPane().add(button3);
    getContentPane().add(button4);
      }//end public method Main
    ////////////////////////////////////////////////////////////////////////////////////
    }//end class Main
    and it worked
    I swear that I am how made program

  5. #5
    Registered User
    Join Date
    Dec 2011
    Posts
    6
    I didn't study c + +. I made this code of personal and , but I studied Java and the data structure for it .

  6. #6
    Registered User
    Join Date
    Dec 2011
    Posts
    6
    sorry , for the spelling mistake (hay) I was meant (hi)
    English isn't my mother language

  7. #7
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,318
    Sorry, we are not a language translation service. Also read the homework policy.
    You have to do the work, we can only give you a little help with specific questions once you've shown that you've done as much as you can on your own, and posted the relevant bit of what you've actually done, here.
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

  8. #8
    Registered User
    Join Date
    Dec 2011
    Posts
    6
    yes this is what i need ,explian for me what is the difference between c and c++ . and I will do it by my self.

  9. #9
    Registered User
    Join Date
    Dec 2007
    Posts
    2,675

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 9
    Last Post: 03-31-2009, 04:23 PM
  2. An interesting code about "struct" in "union"
    By meili100 in forum C++ Programming
    Replies: 3
    Last Post: 04-08-2008, 04:37 AM
  3. "itoa"-"_itoa" , "inp"-"_inp", Why some functions have "
    By L.O.K. in forum Windows Programming
    Replies: 5
    Last Post: 12-08-2002, 08:25 AM
  4. "CWnd"-"HWnd","CBitmap"-"HBitmap"...., What is mean by "
    By L.O.K. in forum Windows Programming
    Replies: 2
    Last Post: 12-04-2002, 07:59 AM