"LOVE YOU ALL"

love

propads

Sunday, 24 June 2012

cs201 assignment

#include<iostream.h>
#include<stdlib.h>
{

// class customer

class customer{
public:
{
void display();
void cus_name(char);

void cus_id(int);
void spending(int);
char getcus_name();
int getcus_id();
int getspending();
}
customer();
customer(int,int,int);
~customer();
int Noname;
int cus_id=0;
int spending =0;
private:
{
char cus_name;
int cus_id,spending;
};
customer::customer();
{
cus_name=NOname;
cus_id=0
spending=0;
cout<<"the defult constructor is called"<<endl;
}
customer::customer(char cus_name,int cus_id);
{
cus_name=Noname;
cus_id=0;
spending=0;
}
}
customer::customer(char cus_name, int cus_id, int spending)
{
cus_name = Noname;
cus_id = 0;
spending = 0;
}

void customer::display()
{
cout << "The customer is " << getcus_name() << "-" << getcus_id() << "-" <<spending()<< endl;
}

void cus_name::setcus_name(char cus_name)
{
cus_name = Noname;
}

void cus_id::setcus_is(int i)
{
cus_id = i;
}

void spending::setspending(int i)
{
spending= i;
}

int cus_name::getcus_name()
{
return cus_name;
}

int cus_id::getcus_id()
{
return cus_id;
}

int spending::getspending()
{
return spending;
}

customer.
int main()
{
return day;
}

int Date::getMonth()
{
return month;
}

int Date::getYear()
{
return year;
}

date.
int main()
{
customer *cusptr;
cuspyr= new customer[3];


customer1.display();
customer2.display();
customer3.display();
}
}

....................

#include <iostream.h>
#include <stdlib.h>
class Customer
{public:
void display();void setName(char [20]);
void setCustomer_id(int i);
void setSpending(int i);int getName();
int getCustomer_id();
int getSpending();
Customer();
//Customer(char[20], int, int);
//Customer(char[20], int, int);
~Customer ();
private:int FnlBill;
int customer_id;
int spending;
char name[20];friend float dis1FnlBill ( Customer ) ;
friend float dis2FnlBill ( Customer ) ;
friend float dis3FnlBill ( Customer ) ;
};// defining the constructor
// default constructor. setting the date to a default date
Customer::Customer()
{
name= 'N' ;
customer_id = 0;
spending = 0;
}
// Constructors with three arguments
Customer::Customer(char thename, int thecustomer_id , int thespending)
{
name = thename;
customer_id = thecustomer_id;
spending = thespending;
//cout "The constructor with two arguments is called" endl ;
}
//Destructor
Customer::~Customer(){
cout "The object has destroyed" endl;
}// The display function of the class date
void Customer::display()
{
cout "The date is " getName() "-" getCustomer_id() "-" getSpending()
endl;
}
// setting the value of the day
void Customer::setName(char[20])
{
name = M_ali;
}
// setting the value of the month
void Customer::setCustomer_id(int i)
{customer_id = i;
}
// setting the value of the year
void Customer::setSpending(int i)
{
spending = i;
}
// getting the value of the day
int Customer::getName()
{
return name;
}
// getting the value of the month
int Customer::getCustomer_id()
{
return customer_id;
}
// getting the value of the year
int Customer::getSpending()
{
return spending;
}
/* Main program. We will take three date objects using the three constructors
(default, two arguments and three arguments and display the date.
*/
// Friend function definition
void FnlBill(Customer *d, int )
{
//d->FnlBill ; // Modify private data
}
// showing the use of the friend function
int main()
{


Customer Bill1, Bill2(a,2,3), Bill3(d,5,6); // taking objects of Date class// displaying the dates on the screen
Bill1.display();Customer *aptr; // Declared a pointer dptr to MyPointer class object
aptr = new Customer [1]; // Created 10 objects of MyDate and assigned the
// pointer to the first object to dptr pointer variable.
delete [] aptr; // Deleted (freed) the assigned memory to the objectsBill2.display();
Customer *bptr; // Declared a pointer dptr to MyPointer class object
bptr = new Customer [1]; // Created 10 objects of MyDate and assigned the
// pointer to the first object to dptr pointer variable.
delete [] bptr; // Deleted (freed) the assigned memory to the objects
char name[20];
int customer_id;
int spending;
cout "Enter Customer Name" endl;
cin >> name ;
cout "Enter Customer customer_id" endl;
cin >> customer_id ;
cout "Enter Customer spendings" endl;
cin >> spending ;Bill3.display();
Customer *cptr; // Declared a pointer dptr to MyPointer class object
cptr = new Customer [1]; // Created 10 objects of MyDate and assigned the
// pointer to the first object to dptr pointer variable.
delete [] cptr; // Deleted (freed) the assigned memory to the objects
/*float spend,;cout "Please enter total spendings " ;
endl;
cin >> spend;if ( spend < 5000 )
{
cout "The Bill is : " dis1FnlBill(Bill3(4,5,6)) endl;
}else if (spend => 5000 && < 10000)
{
cout "The Bill is : " dis2FnlBill(Bill3(4,5,6)) endl;
}
else if ( spend => 10000 )
{
cout "The Bill is : " dis3FnlBill(Bill3(4,5,6)) endl;
}else
{
cout "Pleae epend some thing" endl;
}
Customer *cptr; // Declared a pointer dptr to MyPointer class object
cptr = new Customer [1]; // Created 10 objects of MyDate and assigned the
// pointer to the first object to dptr pointer variable.
delete [] cptr; // Deleted (freed) the assigned memory to the objects//display();*/
system ("pause");
}
/*
float dis1FnlBill ( Bill3(4,5,6))
{
return ( (spend+(5/spend*100))-(1/spend*100)); // Addition of tax

}
float dis2FnlBill ( Bill3(4,5,6))
{
return ( (spend+(10/spend*100))-(2/spend*100)); // Addition of tax
}
float dis3FnlBill ( Bill3(4,5,6))
{
return ( (spend+(15/spend*100))-(3/spend*100)); // Addition of tax
}
..............................
#include <iostream.h>
#include <stdlib.h>
class Customer
{
public:
void display();
void setName(int i);
void setCustomer_id(int i);
void setSpending(int i);
int getName();
int getCustomer_id();
int getSpending();
Customer();
Customer(int, int , int);
~Customer ();
private:
int FnlBill;
int customer_id;
int spending;
int name;
friend float dis1FnlBill(Customer );
friend float dis2FnlBill(Customer );
friend float dis3FnlBill(Customer );
};
Customer::Customer()
{
name= 0;
customer_id = 0;
spending = 0;
}

Customer::Customer(int thename, int thecustomer_id , int thespending)
{
name = thename;
customer_id = thecustomer_id;
spending = thespending;

}
Customer::~Customer()
{
}
void Customer::display()
{
cout getName() getCustomer_id() getSpending();
}
void Customer::setName(int i)
{
name = i ;
}
void Customer::setCustomer_id(int i)
{
customer_id = i;
}
void Customer::setSpending(int i)
{
spending = i;
}

int Customer::getName()
{
return name;
}
int Customer::getCustomer_id()
{
return customer_id;
}
int Customer::getSpending()
{
return spending;
}
void FnlBill(Customer *d, int )
{
// d->FnlBill ; // Modify private data
}

int main()
{

Customer Bill1, Bill2(1,2,3), Bill3(4,5,6); // taking objects of Date class
Bill1.display();
Customer *aptr;
aptr = new Customer [1];
delete [] aptr;
Bill2.display();
Customer *bptr;
bptr = new Customer [1];
delete [] bptr;
int name;
int customer_id;
int spending;
cout<<"Enter Customer Name"<<endl;
cin >> name ;
cout<<"Enter Customer customer_id"<<endl;
cin >> customer_id ;
cout<<"Enter Customer spendings"<<endl;
cin >> spending ;
Bill3.display();
Customer *cptr;
cptr = new Customer [1];
delete [] cptr;
/*float spend,;
cout "Please enter total spendings " ;
endl;
cin >> spend;
if ( spend < 5000 )
{
cout "The Bill is : " dis1FnlBill(Bill3(4,5,6)) endl;
}
else if (spend => 5000 && < 10000)
{
cout "The Bill is : " dis2FnlBill(Bill3(4,5,6)) endl;
}
else if ( spend => 10000 )
{
cout "The Bill is : " dis3FnlBill(Bill3(4,5,6)) endl;
}
else
{
cout "Pleae epend some thing" endl;
}
Customer *cptr; // Declared a pointer dptr to MyPointer class object
cptr = new Customer [1]; // Created 10 objects of MyDate and assigned the
// pointer to the first object to dptr pointer variable.
delete [] cptr; // Deleted (freed) the assigned memory to the objects
//display();*/
system ("pause");
}
/*
float dis1FnlBill ( Bill3(4,5,6))
{
return ( (spend+(5/spend*100))-(1/spend*100)); // Addition of tax
}
float dis2FnlBill ( Bill3(4,5,6))
{
return ( (spend+(10/spend*100))-(2/spend*100)); // Addition of tax
}
float dis3FnlBill ( Bill3(4,5,6))
{
return ( (spend+(15/spend*100))-(3/spend*100)); // Addition of tax
}
*
/


No comments:

Post a Comment