عرض مشاركة واحدة
منتديات طلاب وطالبات جامعة الملك عبد العزيز منتديات طلاب وطالبات جامعة الملك عبد العزيز
  #1  
قديم 01-04-2011, 12:06 PM

شررروق شررروق غير متواجد حالياً

جامعي

 
تاريخ التسجيل: Jun 2010
التخصص: لايوجد
نوع الدراسة: ثانوي
المستوى: الأول
الجنس: أنثى
المشاركات: 14
Skaau.com (15) ابي شرح لسؤال بلغه السي شارب


السلام عليكم ورحمه الله وبركاته

الله يسعدكم

ابي شرح هالسؤال

بلغه السي شارب

1. Create a class called Invoice that a hardware store might use to represent an invoice for an item sold at the store. An Invoice should include four pieces of information as instance variablesa part number (type string), a part deion (type string), a quantity of the item being purchased (type int) and a price per item (decimal). Your class should have a constructor that initializes the four instance variables. Provide a property with a get and set accessor for each instance variable. In addition, provide a method named GetInvoiceAmount that calculates the invoice amount (i.e., multiplies the quantity by the price per item), then returns the amount as a decimal value. If the quantity is negative, it should be left unchanged. Similarly, if the price per item is negative, it should be left unchanged. Write a test application named InvoiceTest that demonstrates class Invoice's capabilities.
رد مع اقتباس