To run the application we will have to compile the cs files that are present in the solution folder.To compile these cs files:-
mcs -out:program.exe Program.cs FuelStation.cs Vehicle.cs Car.cs HGV.cs Van.cs Transaction.cs
Now we will have an exe file with name program.exe in this folder.
App Synopsis:-
This is a very easy to use application that will help us to evaluate any petrol station. It simulates a petrol station having 3 lanes and each lane has 3 petrol stations. For the purpose of demonstrating the app, some things are hardcoded for now.In this application, we have three types of fuels. Each filling station has all the three types of fuels available at all the times.
We have 3 types of Vehicles.
In our application, a new vehicle is getting generated in a random time interval between 1500 and 2200 seconds. This vehicle must be filled within a service time of less than 1000 to 2000 milliseconds and this time is also randomly chosen for each vehicle. If this vehicle is not serviced within the decided time frame, this vehicle leaves the fuelling station without getting the fuel fill and we add 1 to the counter of vehicles which left the station without getting fuel filled.
Our fuelling station is divided into three lanes having 3 fuelling stations in each lane. These three fuelling stations have all the three types of fuels available at all times. Also, if lane 1 has a vehicle which is getting fuelled at station 1, then the station 2 and 3 are blocked and no vehicle can be serviced there as the vehicles cannot move to those fuelling stations. Similarly, this condition is also valid for the other two lanes.
So if any lane is blocked by any vehicle, then all the filling stations after blocked filling station are inaccessible. Our application displays the Station status as soon as a new vehicle comes or a station becomes available. Then the fuel attendant can simply press the fuel station number and the waiting vehicle will be filled at the selected station. An error message is displayed if the selected fuel station is blocked by some vehicle or it is in use by some other vehicle.
After each filling of the station all the details are displayed on the screen which includes, the current status of the fuelling station i.e. which all stations are currently in use and which all stations are free. It also displays a summary as shown:
Total litres of LPG dispensed: 113
Cost of LPG dispensed (£2.49/L): £281.37
Total litres of Unleaded dispensed: 37
Cost of Unleaded dispensed (£3.49/L): £129.13
Total litres of Diesel dispensed: 0
Cost of Diesel dispensed (£4.49/L): £0
1 % commission: £4.105
Number of vehicles serviced: 04
Number of vehicles left before they were filled out: 6
Press the pump number to service the awaiting vehicle:
So all the vehicles that are currently waiting in a queue are displayed here. There can be a maximum of 5 waiting vehicles at a time. Then it displays the total number of LPG, Unleaded and Diesel dispensed along with the revenue generated by selling them. Then, it displays, the commission of the fuel attendant which is 1% of the total revenue generated by him.
After that, it displays the total number of vehicles that were serviced at this fuelling station followed by the vehicles that were left unserved because of service time constraints.
Testing: –
Various test cases were executed on the application and the results of the test cases are as follows:-
We ran our program multiple times to verify that a new vehicle is randomly generated every 1500 to 2200 milliseconds. This new vehicle type is randomly chosen and this can be of any type between Van, HGV and Car.
Test Result: Pass
When a new vehicle is generated its tank is randomly filled from 0 litres to not more than a quarter of its tank capacity. This amount is also randomly chosen and generated with the help of the Random object. We tested this scenario by running our application several times and this scenario passes in all the tests that we ran.
Test Result: Pass
After displaying the current fuelling station on screen, if the user presses fuel station number which is already busy, then a message is displayed to the screen saying that the vehicle cannot be filled at this lane and the control returns again to the user. We have tested this scenario by running the program several times and this scenario passed in all the test cases.
Test Result: Pass
Suppose that a vehicle is getting fuel filled at lane 1, station number 1 and the user presses the command to fill the vehicle at station number 2. This is not possible as the path to this filling station is already blocked by the vehicle at station number 1. In this case, an error message will be displayed on the screen that the vehicle cannot be filled here and the control returns.
Test Result: Pass
For demonstration purpose, we have hardcoded this for now that if a vehicle is not serviced in 1000-2000 milliseconds, then this vehicle leaves the station without getting the fuel filler. This duration can be changed easily at any time.
Test Result: Pass
We are storing the details of the vehicles that are getting their fuel at this station. These details are getting stored in vehicles list. We are not displaying this list on the screen. But we have already tested and all the vehicle details are present in this list.
References
Dybvig, R., The Scheme Programming Language, MIT Press, 2003.
Hejlsberg, A., The C? Programming Language, Addis
Essay Writing Service Features
Our Experience
No matter how complex your assignment is, we can find the right professional for your specific task. Contact Essay is an essay writing company that hires only the smartest minds to help you with your projects. Our expertise allows us to provide students with high-quality academic writing, editing & proofreading services.Free Features
Free revision policy
$10Free bibliography & reference
$8Free title page
$8Free formatting
$8How Our Essay Writing Service Works
First, you will need to complete an order form. It's not difficult but, in case there is anything you find not to be clear, you may always call us so that we can guide you through it. On the order form, you will need to include some basic information concerning your order: subject, topic, number of pages, etc. We also encourage our clients to upload any relevant information or sources that will help.
Complete the order formOnce we have all the information and instructions that we need, we select the most suitable writer for your assignment. While everything seems to be clear, the writer, who has complete knowledge of the subject, may need clarification from you. It is at that point that you would receive a call or email from us.
Writer’s assignmentAs soon as the writer has finished, it will be delivered both to the website and to your email address so that you will not miss it. If your deadline is close at hand, we will place a call to you to make sure that you receive the paper on time.
Completing the order and download