Page 1 of 1

PSEUDOCODE

Posted: Thu Jan 17, 2019 3:26 am
by meobeou
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!!!

Lee!

Re: PSEUDOCODE

Posted: Thu Jan 17, 2019 4:36 am
by FourthWorld
Does your question have anything to do with the LiveCode programming language?

Re: PSEUDOCODE

Posted: Thu Jan 17, 2019 12:40 pm
by bogs
I suspect aBot walked in, since anyone who -
meobeou wrote:
Thu Jan 17, 2019 3:26 am
knows their pseudocode...
would know that it has nothing to do with designing an algorithm, but rather is more like a story-line that describes what you want to do in a particular language, so the question makes no sense.

Re: PSEUDOCODE

Posted: Thu Jan 17, 2019 7:23 pm
by richmond62
knows their pseudocode
seems very odd to me as I always thought that "pseudocode" was NOT something rigidly
defined like "real" programming languages, but simply a way to jot down the logical
underpinnings that will need to be written into real code once one gets up and running.

Therefore there could be as many pseudocodes as there are people writing it.

Re: PSEUDOCODE

Posted: Thu Jan 17, 2019 8:25 pm
by richmond62

Re: PSEUDOCODE

Posted: Thu Jan 17, 2019 8:31 pm
by capellan
Hi meobeou,
meobeou wrote:
Thu Jan 17, 2019 3:26 am
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.
Looks like this assignment is similar to the topic of this IEEE paper:
Pricing strategy for perishable food considering consumer's fairness perception
https://ieeexplore.ieee.org/document/6874114
and many more similar studies:
https://www.tandfonline.com/doi/abs/10. ... ode=tprs20

The first time that I learned about this topic was in 2003 while
working in a project for University ISA
https://www.isa.edu.do/

Here is an idea for calculating this:

1) Register /initial acquisition date for this product/initial sale price/
product code/current sale date/daily depreciation

For example:
2019-02-21/10.00 each Kg/Product I-23B03/2019-02-24/-0.012 cents

in this particular case, the product just lose 0.036 cents of its original value
from the day 21, so the store have the option to sell at the original price of
10.00 each Kg and give the buyer a coupon for the discount value (0.036 cents)
or add another product for that value (0.036 cents) to the purchase.

Tell me if this explanation makes sense as english is my second language.

Al

Re: PSEUDOCODE

Posted: Thu Jan 17, 2019 9:58 pm
by bogs
richmond62 wrote:
Thu Jan 17, 2019 7:23 pm
knows their pseudocode
seems very odd to me as I always thought that "pseudocode" was NOT something rigidly
defined like "real" programming languages, but simply a way to jot down the logical
underpinnings that will need to be written into real code once one gets up and running.

Therefore there could be as many pseudocodes as there are people writing it.
Exactly so. In the case of the (if not a bot) OP's post, they have already posted the psuedocode they are asking about.

Code: Select all

/* psuedo-code...*/
if the product was bought within 7 days then
	x% of it is profit
 else
	y% of it is profit
end if

Re: PSEUDOCODE

Posted: Thu Jan 17, 2019 10:00 pm
by FourthWorld
OP's first and only post here, nothing to do with LC, no sign of the OP since - I'm going to delete this thread soon unless there's a reason we should keep it.

Re: PSEUDOCODE

Posted: Thu Jan 17, 2019 10:02 pm
by bogs
I only feel bad Al put so much into it. That really is good information Al :D

Re: PSEUDOCODE

Posted: Fri Jan 18, 2019 12:43 am
by capellan
A discount of 3 cents for a product looks irrelevant but when you
start counting all the money offered in discounts, coupons and offers
suddenly collecting all these bits makes a lot of sense.

https://blog.accessdevelopment.com/ulti ... statistics

Re: PSEUDOCODE

Posted: Fri Jan 18, 2019 11:35 am
by richmond62
an assignment question which is giving me trouble
I think this is nothing more than a "lazy so-and-so" trying to get someone else to
do their work for them.

Re: PSEUDOCODE

Posted: Fri Jan 18, 2019 11:58 am
by FourthWorld
richmond62 wrote:
Fri Jan 18, 2019 11:35 am
an assignment question which is giving me trouble
I think this is nothing more than a "lazy so-and-so" trying to get someone else to
do their work for them.
It's a sticky issue indeed. I borrowed heavily from the collective experience of the Ubuntu forums when drafting this forum's guidelines (see "Homework assistance" under "Suggestions for Posting":
https://forums.livecode.com/viewtopic.php?f=4&t=18885

Re: PSEUDOCODE

Posted: Fri Jan 18, 2019 12:17 pm
by bogs
LOL! This was the first time I've read that, and I found I broke all but 3 of the suggestions for posting :oops: