تقييم الموضوع :
  • 0 أصوات - بمعدل 0
  • 1
  • 2
  • 3
  • 4
  • 5
سؤال عن لغة c# ارجو حله اليوم قبل الساعة 10
#1
it).
Work requested for this home work:
In this assignment you will write a code to model the behavior of a small fuel pump (محطة وقود ). Fuel pumps are used to pump petrol/gasoline, diesel, kerosene, or other types of fuel into vehicles and calculate the financial cost of the fuel sold.
Our fuel pump station has only one dispenser ( مضخة ) which dispenses only two types of fuel: gasoline (كاز ) and diesel (ديزل ).
Write the following two classes:
1. Class named Tank with the following members:
 private fields
a) FuelType: store the type of the fuel (gasoline or diesel) in the tank, 'g' for gasoline, 'd' for diesel.
b) fuelQuantity: store the amount of the fuel (gasoline or diesel) in the tank in Liter
c) costPerLiter: store the prices per Liter of the fuel in the tank.
d) fuelSold: store the amount of the overall sold fuel from the tank (in Liter)
 public methods:
1- Default constructor to initialize fields.
2- A constructor with 4 parameters to set the fields of the class.
3- 4 set and 4 get methods for the FuelType, fuelQuantity, costPerLiter, and fuelSold fields.
2. Class named FuelPump that contains the following members:
 private field:
1- TankList of type Tank: an array of 2 elements to store the information of the two tanks (Tank 1 and Tank 2)
 public methods:
1- A constructor with 6 parameters to set the values of FuelType, fuelQuantity and costPerLiter for each tank in the array. The fuelSold for each tank initialized to 0.
CPE 311
Assignment-1
Instructor: Eng. Mohammed Al-Hammouri
Deadline: Saturday 20/10/2016 by 22:00
2- A method called SetPricePerLiter with two parameters to give a new price (per Liter) for each type of fuel.
3- A method called BuyFromSupplier (الشراء من مزود الوقود ) with two parameters: (quantity and the type of fuel), that allows buying a quantity of fuel in Liter from supplier.
4- A method called Sell (بيع الوقود للزبائن ) with two parameters: quantity in liters and type of fuel to sell an amount of fuel to a customer by Liter. This function should also prints out the customer’s bill.
5- A method called Reset to reset the amount of sold fuel for each tank to 0
6- A method called DisplayInfo to print out amount of fuel in tank1 and tank2, and the fuel prices in JD per Liter.
7- A method called DisplaySoldInfo to print out the total amount of sold fuel (in Liters) for each tank and the total amount of money earned during the pay period.
3. In the Main
 Declare an object of type FuelPump, with the following information for each tank. Tank1: gasoline, 200 Liters, 0.83JD, Tank2: diesel, 120 Liters, 0.55JD.
 Allow the following Menu to appear:
***************************
Fuel Pump Modeling Program
***************************
1 - Display Information for each Tanks
2 - Set a new price
3 - Buy from a supplier
4 - Sell to customer and Display customer’s bill
5 - Display the total sold fuel for each tanks and the total
amount of money earned during the pay period.
6 - Reset sold fuel.
7 - Exit
***************************
Choice:
الرد
تم الشكر بواسطة:


المواضيع المحتمل أن تكون متشابهة .
الموضوع : الكاتب الردود : المشاهدات : آخر رد
  [سؤال] سؤال عاجل لو سمحتم Raghad l 1 35 16-11-18, 02:11 PM
آخر رد: rmnr
  [C#.NET] ممكن سؤال دموع الوطن 2 144 23-09-18, 04:14 AM
آخر رد: محمد كريّم
  سؤال عن كيفية جلب صورة أو ملف صوتي من مجلد داخل المشروع بتقنية WPF younass 2 191 01-09-18, 02:43 PM
آخر رد: elgokr
  فتح فورمات متعددة.......ارجو المساعدة khalilfox 9 454 30-08-18, 12:57 PM
آخر رد: elgokr
  سؤال عن كيفية فتح فورم داخل فورم اخر بتقنية WPF younass 0 153 30-08-18, 01:28 AM
آخر رد: younass
  سؤال عن كيفية تحديد قيمة عمود في السطر المحدد في datagrid مع تقنية wpf younass 8 352 27-08-18, 11:10 PM
آخر رد: elgokr
  سؤال عن كيفية نقل البيانات من بعض الاعمدة من اكسس او الاكسل الى SQl server younass 1 143 04-08-18, 11:50 PM
آخر رد: Finish
  سؤال حول الاجراءات المخزنة في قاعدة البيانات younass 2 184 31-07-18, 03:22 PM
آخر رد: younass
  سؤال عن كيفية عرض حقول معينة في dataGridView1 علما اني الاستعلام يكون لجميع الحقول younass 2 182 29-07-18, 05:13 PM
آخر رد: younass
  اريد ان اجعل برنامجي يعمل بسيريال و نسخة تجريبية ارجو المساعدة من الاعضاء tameur 1 452 18-06-18, 08:35 PM
آخر رد: elgokr

التنقل السريع :


يقوم بقرائة الموضوع: بالاضافة الى ( 1 ) ضيف كريم