2020 - Outlet

From TRCCompSci - AQA Computer Science
Revision as of 13:41, 27 January 2020 by Admin (talk | contribs) (Created page with "==Variables== ===Random=== private static Random rnd ===int=== protected int visitsToday, xCoord, yCoord, capacity, maxCapacity; ===double=== protected double dailyCosts;...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Variables

Random

private static Random rnd

int

protected int visitsToday, xCoord, yCoord, capacity, maxCapacity;

double

protected double dailyCosts;

Methods

Constructor

GetCapacity

This will just return the capacity stored in 'capacity'.

GetX

This will just return the value of 'xCoord'.

GetY

This will just return the value of 'yCoord'.

AlterDailyCost

This accepts a parameter called 'amount' (a double), this method will just add the value of 'amount' to the 'dailyCosts' variable.

AlterCapacity

IncrementVisits

This method will just increment the 'visitsToday' variable using 'visitsToday++'.

NewDay

This will just reset the 'visitsToday' back to 0.

CalculateDailyProfitLoss

This method will accept parameters for 'avgPricePerMeal' and 'avgCostPerMeal'. It will then return the result of this calcualtion:

(avgPricePerMeal - avgCostPerMeal) * visitsToday - dailyCosts

GetDetails