PSEUDOCODE

Want to talk about something that isn't covered by another category?

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
meobeou
Posts: 1
Joined: Thu Jan 17, 2019 3:12 am

PSEUDOCODE

Post by meobeou » 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.

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

Lee!

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: PSEUDOCODE

Post by FourthWorld » Thu Jan 17, 2019 4:36 am

Does your question have anything to do with the LiveCode programming language?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: PSEUDOCODE

Post by bogs » Thu Jan 17, 2019 12:40 pm

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.
Image

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: PSEUDOCODE

Post by richmond62 » 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.

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: PSEUDOCODE

Post by richmond62 » Thu Jan 17, 2019 8:25 pm


capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Re: PSEUDOCODE

Post by capellan » Thu Jan 17, 2019 8:31 pm

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

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: PSEUDOCODE

Post by bogs » Thu Jan 17, 2019 9:58 pm

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
Last edited by bogs on Thu Jan 17, 2019 10:00 pm, edited 1 time in total.
Image

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: PSEUDOCODE

Post by FourthWorld » Thu Jan 17, 2019 10:00 pm

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.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: PSEUDOCODE

Post by bogs » Thu Jan 17, 2019 10:02 pm

I only feel bad Al put so much into it. That really is good information Al :D
Image

capellan
Posts: 654
Joined: Wed Aug 15, 2007 11:09 pm

Re: PSEUDOCODE

Post by capellan » Fri Jan 18, 2019 12:43 am

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

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9287
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: PSEUDOCODE

Post by richmond62 » 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.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9802
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: PSEUDOCODE

Post by FourthWorld » Fri Jan 18, 2019 11:58 am

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
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

bogs
Posts: 5435
Joined: Sat Feb 25, 2017 10:45 pm

Re: PSEUDOCODE

Post by bogs » Fri Jan 18, 2019 12:17 pm

LOL! This was the first time I've read that, and I found I broke all but 3 of the suggestions for posting :oops:
Image

Post Reply

Return to “Off-Topic”