Page 1 of 1

PSEUDOCODE HELP

Posted: Tue May 19, 2015 8:34 am
by mgorg199
Hi, I am new to studying IT and i have an assignment question which is giving me trouble.

A little off topic, but if anyone here knows their pseudocode I have a question for you. I need to design an algorithm that calculates how much profit can be made by multiplying the remaining weight of stock and the price paid per KG. That part isn't too difficult however I need to apply profit margins: if the product was bought within 7 days only x% of it is profit, more than 7 days ago y% of it is profit.

Would appreciate any help and sorry for being off topic and a noob!!!

Re: PSEUDOCODE HELP

Posted: Tue May 19, 2015 1:02 pm
by Klaus
Hi mgorg199,

maybe you want to explain what this has to do with Livecode? 8)

In the meantime I can give you some hints, although you already answered your own question!
... if the product was bought within 7 days only x% of it is profit, more than 7 days ago y% of it is profit
Here the hints in pseudocode:

Code: Select all

...
if TODAY - date_of_purchase <= 7 then
   PROFIT = x
ELSE
  PROFIT = y
end if
...
And since this is not really OFF-TOPIC I will move the thread to the beginners section.


Best

Klaus