c#


Difficulty starting computing project


I am struggling to complete this assignment and I am don't know how to start.
Could anyone give me any suggestions.
This is a link to the specification: https://www.dropbox.com/s/mtmyb4rbhqwyr10/MOD003212%20Assignment%202%20Specification.pdf?dl=0
This is Program.cs
using System;
using System.Collections.Generic;
using System.Timers;
namespace AssignmentBasic
{
class Program
{
public static List<Car> carList = new List<Car>();
public static Timer carTimer;
private static int interval = 1500;
private static Random num = new Random(DateTime.Now.Second);
private static Timer pumpAssignment;
public static Station station;
static void Main(string[] args)
{
station = new Station();
carTimer = new Timer();
carTimer.Interval = 1500;
carTimer.AutoReset = true;
carTimer.Elapsed += new ElapsedEventHandler(CreateCar);
carTimer.Start();
pumpAssignment = new Timer();
interval = num.Next(5000, 7000);
pumpAssignment.Interval = interval;
carTimer.AutoReset = true;
pumpAssignment.Elapsed += new ElapsedEventHandler(assignCar);
pumpAssignment.Start();
Console.ReadLine();
}
static public void CreateCar(object source, ElapsedEventArgs e) {
Car newCar = new Car();
carList.Add(newCar);
Console.WriteLine("Car created");
}
static public void assignCar(object obj, ElapsedEventArgs e) {
for (int i = 0; i < station.pumps.Count; i++)
{
if (station.pumps[i].Assigned == false) {
station.pumps[i].AssignedCar = carList[0];
carList.RemoveAt(0);
station.pumps[i].Assigned = true;
Console.WriteLine("Car assigned to pump {0}", i + 1);
}
}
}
}
}
This is Station.cs
using System;
using System.Collections.Generic;
using System.Timers;
namespace AssignmentBasic
{
class Station {
int numPumps = 9;
int litresDispensed;
int costOfLitres;
int commision;
int numberOfVehiclesServiced;
public List<Pump> pumps = new List<Pump>();
Timer carTimer;
public Station() {
createPumps();
carTimer = new Timer();
}
public void createPumps() {
for (int i = 0; i < numPumps; i++) {
pumps.Add(new Pump());
}
}
public void displayForecourt() {
}
public void assignToPump()
{
}
}
}
This is Pump.cs
using System;
using System.Timers;
namespace AssignmentBasic{
class Pump {
private int pumpTime = 18000;
private double pumpRate = 1500;
private Car assignedCar;
public Car AssignedCar { get => assignedCar; set => assignedCar = value; }
private bool assigned = false;
public bool Assigned { get => assigned; set => assigned = value; }
private Timer fuelTimer;
public void fuelVehicle() {
fuelTimer = new Timer();
fuelTimer.Interval = pumpTime;
}
public void addTransaction() {
}
public void assignCar()
{
}
}
}
This is Car:
using System;
using System.Collections.Generic;
using System.Timers;
namespace AssignmentBasic {
class Car {
private Timer fuelingTimer;
public Car()
{
}
}
}
This is the functionality that is required:
A new vehicle is created every 1.5 seconds
When a vehicle is sent to a pump, the fuelling process will take 18 seconds. At the end of the 18 seconds the number of litres despensed is recorded and the vehicle leaves the forcourt, freeing the pump for use.
The Pump is capable of despensing 1.5 letres / second
A newly created vehicle can wait until it is sent to a pump without a time limit
Counters 1 - 4 and 6 have to be implemented
Counters: Running totle of litres dispensed, Amount of money these litres equate to, 1% commision, the number of vehicles serviced. keep a detailed list of each fuelling transaction

Related Links

Timer in AudioPlaybackAgent
Display Database value on an Image
InvalidOperationException when hide window
32feet bluetooth client fails to connect
Func<T, U, double> et al. as a Parameters in Constructor
Read GPU temperature in C#
Error The conversion of a varchar data type to a datetime data type resulted in an out-of-range value
To execute the AJAX call to ASP.NET WEb Application
Disabling WebBrowser ActiveX Warning
Validation in Windows form using c# in .net
base64 string image data is not completly displaying in ie8
File not found when assets used as linked content
How can I open an Excel file from C#/WPF in “Full Screen”?
Dictionary KeyNotFoundException NOT giving error … WHY?
BadImageFormatException was unhandled
C# calling a Java web service method that has a List input parameter [duplicate]

Categories

HOME
qlikview
joomla
optimization
virtual-machine
formatting
display
opencv4android
magento-1.9.2.1
spss
sms
procmon
zabbix
theory
oms
websharper
watson-dialog
browsermob
saucelabs
lambda-calculus
background-image
jsfiddle
reportlab
git-branch
serenity-js
dev-c++
screen-scraping
rvm
quality-center
sasl
continuous-fourier
angular2-changedetection
apm
availability
ponylang
lfe
mtm
python-venv
azure-data-catalog
reqif
spring-ide
line-endings
jks
noise
ajv
webmatrix
try-catch-finally
petapoco
scrollmagic
mavlink
dimensionality-reduction
dbi
jira-agile
require-handlebars
nimbus
audiorecord
trendline
methodology
markerspiderfier
clear
android-facebook
commercetools
mojolicious
tinymce-plugins
genome
service-broker
mri
aiff
frisby.js
parallel-port
rpt
fade
ie-developer-tools
ojb
kohana-orm
typography
auctex
gssapi
aspmenu-control
github-archive
copyfile
rollover
nyromodal
nstoolbar
iphone-maps
hp-trim
calendarextender
rpxnow
authkit
cstring
managed-code

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App