Session expiration Your session is going to expireClick here to extend

Budget (€) :

Small project <800

Posted on

10/4/12 1:22 AM

This project has expired

Why don't you register anyway? We are sure that you will find many similar projects out of the thousands waiting for you!

Post similar project now




Assignment: implement the application step by step.

-          Start a new C#-solution and give it a suitable name, like CarApp.

-          Give the window an appropriate name and change the text on the title-bar of the window in an appropriate text. Complete the user interface like in the screenshot in the introduction part. Do not pay too much attention to the picturebox with the picture of your car. We will do this later.

-          Add a new class to the project. The name of this class  should be Car and the it should be stored in the file "Car.cs"

-          The class car contains at least the following attributes:

o   brand (a string) The name of the brand, for example “Ford”.

o   tankCapacity (an int) The capacity of the tank in liters, for example 30.

o   mostRecentTotalKilometers (an int) The most recent  mileage of the car (so the mileage at the last fill-up).

o   earlierTotalKilometers (an int) The mileage of the car at the last but one fill-up.

o   mostRecentTotalLiters (an int)  The total number of liters fuel tanked, inclusive the last fill-up.

o   earlierTotalLiters (an int)  The total number of liters fuel tanked before the last fill-up.

o   imageFilename a (string) The filename of the image of the car.

-          The car class also contains at least the methods (implement these methods):

o   UpdateCar( . . . ) Updates the attributes of the car using the last fill up details (the liters of fuel and the mileage)

o   FuelEfficiencyLastFillUp( ) Returns the fuel efficiency (how many kilometers for 1 liter fuel) from the last fill up. Be aware: we store information about the kilometers and the fuel in whole numbers, but we want the fuel efficiency more precise. An example: you drove 300 kilomers between last fill up and the current fill up and you tanked 17 liters fuel. Then the fuel efficiency is 300 / 17, so it is 17.65.

FuelEfficiencyOverall( ) Returns the overall efficiency ( = total mileage, divided by total liters of fuel).