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

Composite iterator with queue
Capture WinForms console messages (debug) from another program?
how to assign backspace as back key
InstallSheild Limited Edition not working on VS 2015
Update listbox asynchronously winforms
WPF Grid Column resize order
How to convert PDF page to c# Bitmap object (not to file)? [closed]
Complexity of swapping Dictionary type arguments in C#
Deploying .Net Application on AWS using Oracle Db. Getting error with Oracle Provider
Creation of an object in a try block
How to restirct user from entering Space in Textbox C#
Can a Microsoft Bot Framework based bot be connected to multiple channels?
Queueing and Dequeueing multiple types
Optional table in SpecFlow
Issue when using 1and1 SMTP mail Client with Identity
C# How to insert array into object mongodb

Categories

HOME
qlikview
javafx
url
botframework
oracle-sqldeveloper
formatting
webvr
opencv4android
mifare
hiveql
xss
download
docker-compose
scapy
software-collections
soap-client
dcos
xmlhttprequest
typedef
angular2-pipe
aws-iot
pumping-lemma
priority-queue
pixels
akavache
sqldependency
emr
ios9
schedule
visual-studio-debugging
incapsula
wit-ai
rythm
latency
keychain
scrapinghub
synchronized
runner
serialversionuid
perldoc
playframework-1.x
richtext
boost-regex
require-handlebars
mate-desktop
geokit
hfp
weblogic-maven-plugin
laterjs
bbedit
jersey-test-framework
apache2-module
nonblocking
computability
om
page-flipping
jsoncpp
bootstrap-tabs
pagecontrol
playn
tidesdk
copy-on-write
bungeecord
strcpy
chunks
qxorm
qf-test
nspopupbutton
code-smell
image-preloader
email-headers
pthreads-win32
grape-api
source-depot
simplemembership
dnsbl
correctness
xcode4.6.3
android-memory
jquery-ui-map
eeprom
joomla1.7
wdm
backlight
method-call
nyromodal
nscharacterset
iphone-maps
coderush-xpress
datadude
paperless

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