2020 - Outlet

From TRCCompSci - AQA Computer Science
Revision as of 12:43, 27 January 2020 by Admin (talk | contribs) (GetDetails)
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

This declares a new string called 'details' which is then used to concatenate several bit of information together.

This string is then returned.