test
This commit is contained in:
parent
37776af5db
commit
ab03d5f10c
4045 changed files with 286212 additions and 3 deletions
73
.config/Code/User/History/65ec6aae/CetG.cpp
Normal file
73
.config/Code/User/History/65ec6aae/CetG.cpp
Normal file
|
@ -0,0 +1,73 @@
|
|||
/*
|
||||
Rafay Ahmad
|
||||
23I-2526
|
||||
*/
|
||||
#include <iostream>
|
||||
using namespace std;
|
||||
|
||||
class Customer{
|
||||
string name;
|
||||
string address;
|
||||
|
||||
public:
|
||||
|
||||
string getName(){
|
||||
return name;
|
||||
}
|
||||
string getAddress(){
|
||||
return address;
|
||||
}
|
||||
};
|
||||
|
||||
class Product{
|
||||
string name;
|
||||
double price;
|
||||
|
||||
public:
|
||||
|
||||
string getName(){
|
||||
return name;
|
||||
}
|
||||
double getPrice(){
|
||||
return price;
|
||||
}
|
||||
};
|
||||
|
||||
class Order{
|
||||
Customer customer;
|
||||
Product *products;
|
||||
int *qtys;
|
||||
int noOfProducts;
|
||||
public:
|
||||
|
||||
Order(Customer customer) : customer(customer), noOfProducts(0){}
|
||||
~Order(){
|
||||
delete[] products;
|
||||
delete[] qtys;
|
||||
}
|
||||
|
||||
void addItem(Product product, int qty){
|
||||
products[noOfProducts] = product;
|
||||
qtys[noOfProducts] = qty;
|
||||
noOfProducts++;
|
||||
}
|
||||
|
||||
void displayOrder(){
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
};
|
||||
|
||||
|
||||
int main(){
|
||||
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue