Friday, 6 February 2015

OOMPL: Assignment3(unfinfished)

//============================================================================
// Name        : Databass.cpp
// Author      : Parashar
// Version     :
// Copyright   : Have some ORIGINALITY ;p
// Description : Hello World in C++, Ansi-style
//============================================================================

#include <iostream>
using namespace std;
#define X 20

class data
{
private:
    char *name,*blood_grp,*dob;
    long int *liscence_number,*mobile_number;
    double *height,*weight;
public:
    data();
    void addCustomer();
    void display();
};

data::data()
{
    this->name=new char[X];
    this->blood_grp=new char[X];
    this->dob=new char[X];
    this->liscence_number=new long int;
    this->mobile_number=new long int;
    this->height=new double;
    this->weight=new double;
}

void data::addCustomer()
{
    cout<<"Enter name:-"<<endl;
    cin>>name;
    cout<<"Enter blood group:-"<<endl;
    cin>>blood_grp;
    cout<<"Enter Date of Birth"<<endl;
    cin>>dob;
    cout<<"Enter Liscence number:-"<<endl;
    cin>>*liscence_number;
    cout<<"Enter Mobile number:-"<<endl;
    cin>>*mobile_number;
    cout<<"Enter height:-"<<endl;
    cin>>*height;
    cout<<"Enter weight:-"<<endl;
    cin>>*weight;
}

void data::display()
{
    cout<<name<<" "<<blood_grp<<"\t   "<<dob<<"   \t"<<(*liscence_number)<<"  "<<(*mobile_number)<<"\t"<<(*height)<<"\t"<<(*weight)<<endl;
}

int main()
{
    cout << "!!!!Made by PARASHAR!!!!" << endl; // prints !!!!Made by PARASHAR!!!!
    char ans;
    data d;
        char *name,*blood_grp,*dob;
        int *liscence_number;
        long int *mobile_number;
        double *height,*weight;
    cout<<"MENU:->"<<endl;
    cout<<"1)Add Customer \n2)Display Customer Detials "<<endl;
    do
    {
        int choice;
        cout<<"please enter you selection \n";
        cin>>choice;
        switch (choice) {
            case 1:
                    d.addCustomer();
                break;
            case 2:
                cout<<"  NAME  |bloodgrp|  DOB  | liscence no. | mobile no. | height | weight "<<endl;
                    d.display();
                    break;
            default:
                cout<<"invalid choice,please choose carefully";
                break;
        }
        cout<<"do u waNNa continue?";
        cin>>ans;
    } while (ans=='y'||ans=='Y');

    return 0;
}


//______________________________________________________________________________________________________________
//                     OUTPUT
//______________________________________________________________________________________________________________
//!!!!Made by PARASHAR!!!!
//MENU:->
//1)Add Customer
//2)Display Customer Detials
//please enter you selection
//1
//Enter name:-
//Parashar
//Enter blood group:-
//O+ve
//Enter Date of Birth
//23/8
//Enter Liscence number:-
//321654
//Enter Mobile number:-
//8149487242
//Enter height:-
//175
//Enter weight:-
//60
//do u waNNa continue?y
//please enter you selection
//2
//  NAME  |bloodgrp|  DOB  | liscence no. | mobile no. | height | weight
//Parashar O+ve       23/8       321654  8149487242    175    60
//do u waNNa continue?

No comments:

Post a Comment