dotfiles/.config/Code/User/History/65ec6aae/TCkE.cpp
RafayAhmad7548 ab03d5f10c test
2024-06-16 18:53:25 +05:00

76 lines
No EOL
999 B
C++

/*
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), products(nullptr), qtys(nullptr){}
~Order(){
if(products != nullptr){
delete[] products;
products = nullptr;
}
delete[] qtys;
}
void addItem(Product product, int qty){
products[noOfProducts] = product;
qtys[noOfProducts] = qty;
noOfProducts++;
}
void displayOrder(){
}
};
int main(){
return 0;
}