0% found this document useful (0 votes)
4 views9 pages

Discrete

Uploaded by

amnasaleem579
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views9 pages

Discrete

Uploaded by

amnasaleem579
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Topic:

Data Structure Project about Bike Selling System

Project Code:

#include<iostream>

#include<conio.h>

#include<string.h>

using namespace std;

string data;

struct BikeSelling {

string OwnerName;

int phone_no;

int model_no;

int chase_no;

BikeSelling *next;

};

class bikes{

private:

BikeSelling *head,*tail;
public:

bikes()

head=tail=NULL;

void projectname(){

cout<<endl;

cout<<endl;

cout<<" <<:::::::::::: BIKE SELLING SYSTEM :::::::::::>> "<<endl;

cout<<" _______________________________________________ "<<endl;

cout <<" =============================================== "<<endl;

cout<<endl;

void addBikeDetails()

cout<<"Enter name of owner "<<endl;

string OwnerName;

cin>>OwnerName;

cout<<"Enter phone number"<<endl;

double phone_no;

cin>>phone_no;

cout<<"enter model number"<<endl;


double model_no;

cin>>model_no;

cout<<"enter chase number"<<endl;

double chase_no;

cin>>chase_no;

BikeSelling *tmp=new BikeSelling;

tmp->OwnerName=OwnerName;

tmp->phone_no=phone_no;

tmp->model_no=model_no;

tmp->chase_no=chase_no;

tmp->next=NULL;

if(head==NULL)

head=tail=tmp;

else

tail->next=tmp;

tail=tail->next;

}}
void search()

BikeSelling *prev=NULL;

BikeSelling *current=NULL;

int chase_no;

cout<<"Enter Chassis number to search:"<<endl;

cin>>chase_no;

prev=head;

current=head;

while(current->chase_no!=chase_no)

prev=current;

current=current->next;

cout<<"\nOwner Name: "<<endl;

cout<<current->OwnerName;

cout<<"\nPhone No:"<<endl;

cout<<current->phone_no;

cout<<"\nModel No of Bike:"<<endl;

cout<<current->model_no;

cout<<"\nChassis No:"<<endl;

cout<<current->chase_no;

getch();

}
void show(){

cout<<"_______________________________________________________________________
________";

cout<<"\n";

cout<<"| owner Name | p NO | Model of Bike | Chassis no |";

cout<<"\n";

cout<<"-------------------------------------------------------------------------------";

BikeSelling *temp;

temp = tail;

while(temp != NULL){

cout<<"\n";

cout<<"|\t"<<temp->OwnerName<<"\t|\t"<<temp->phone_no<<"\t|\t"<<temp-
>model_no<<"\t|\t"<<temp->chase_no<<"\t\t";

cout<<"\n";

cout<<"-----------------------------------------------------------------\n";

temp = temp->next ;

cout<<endl;

}}

};

int main()

system("color 4E");
bikes b;

int n;

do{

b.projectname();

cout<<"Press 1 to add Bikes details\nPress 2 to show details \nPress 3 to search\nPress 4 to Exit


"<<endl;

cin>>n;

if(n==1)

b.addBikeDetails();

else if(n==2)

b.show();

else if(n==3)

b.search();

else if(n==4)
{

exit(0);

else

while(n!=4);

}
Output:

You might also like