Reputation: 19
http://tinypic.com/r/35lug3r/5
The sheet says write a pseudocode program but I've been told to do that + Python.
The question is in the link. I am not asking for a full solution, but for how I would approach it. I've just started Python so I'm not that good using it. I don't understand how a solution would be achieved considering no values have been given.
The sheet also says (not on the image) that you only need 3 of the 4 variables, which I also don't understand. (not assuming the panels are square)
Upvotes: 1
Views: 282
Reputation: 42597
The point of the question is to write a program that can calculate the answer given different input values. That's why you don't need any actual values - it's the algorithm it wants, not a particular numerical answer.
You probably want to define some test values though, and do the calculation manually, so you can check your code is working correctly.
Re: the 3 of 4 values, there appears to be an assumption that the fence panels will be used the "normal" way up, so the height is determined by the height of the panels. Either that, or you can use them either way round (which would be a bit odd, and would mean there are two possible answers for each input, unless the panels are square).
Upvotes: 1
Reputation: 4350
I'd start by suggesting you use the four nouns in boldface as your variables. Try to think about how they are related, and express that algorithmically. It's a good exercise to solve this yourself. With a problem like this, start algebraically, and don't worry about coding. Once you have an algebraic expression that describes the correct relationship, then you can address coding it.
Upvotes: 0