/* This is my psuedo code for Supply/Demand/MaxProfit I recommend the dealership use this section our of bundle every quarter (3 months). That way it can determine the supply and demand of each truck often enough to figure out how many trucks they should have in stock and how many they should sell. I say that so the information they get stays accurate to their time instead of once a year where the data becomes less reliable, while giving it enough time (3 months) for the data not to be influenced too much by a fluke month of sales. I'm not sure what you guys want to do this, if I sum it up in my class or in the inventory. But I'm going to need the total amount of sales of each truck over the past 3 months. I'll also need the amount of sales of each truck over the past year. Because the first quarter of the year should use the total data from the completed past year I'll be using combinations of the variables (which should come out to about 24 variables 3 Different trucks * 4 variations of individual trucks * 2 seperate years of trucks sold = 24 variables of trucks. That is just the combinations of variables for the trucks, then we have the combinations of other variables used in the forumla basically, I'm going to have a TON of varibles in this part of the bundle. I think I devised a good formula to make the calculations simple though. */ o // older truck year n // newer truck year r // ranger f // f-150 s // superduty Ir //Invoice on ranger If //Invoice on f-150 Is // Invoice on SuperDuty n // normal xc // extended cab xb // extended bed xbc // extended cab and bed MaxSpend = 0; // amount dealership can spend on trucks totIn // total Invoice t = 0; // total trucks to be bought p // percentage of total trucks sold last time totIn = sum of (Invoice of each truck * percentage of total trucks sold for that truck); t= MaxSpend / totIn; r = pr * t; //my example of the formula that will be used to determine how many trucks the dealership needs to buy for this quarter