Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- public class Program
- {
- public class Product
- {
- public string name;
- public int price;
- public string category;
- public int discount;
- public void assign(string na, int pr, string cate, int dis) {
- name=na; pr=price; cate=category; discount = dis;
- }
- }
- public class bill
- {
- public int get_bill(Product product1, Product product2, Product product3)
- {
- int totalbill = 0;
- totalbill+=(product1.price-product1.discount);
- totalbill+=(product2.price-product2.discount);
- totalbill+=(product3.price-product3.discount);
- return totalbill;
- }
- }
- public static void Main()
- {
- Product[] Bill = new Product[3];
- Bill[0].assign("Keyboard",1000,"Accessories", 120);
- Bill[1].assign("Proccessor",10000,"Accessories", 1200);
- Bill[2].assign("MotherBoard",7000,"Accessories", 620);
- bill ob = new bill();
- Console.WriteLine(ob.get_bill(Bill[0], Bill[1], Bill[2]));
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement