I was hoping one of you may help me with this question:
If the median price of an apple is defined as the closest price to the price of a banana. Meaning:
Banana price is 2.2
Range of apples prices:
1
2
3
4
5
6
7
Hence in this case the answer is 2
How I write a function that would return the median apple from that list? And also how do I define the variable define the variable type you would use to accomplish this task.
I am hoping that someone can write just pseudo-code for this function.
Thanks in advance for your reply!
If the median price of an apple is defined as the closest price to the price of a banana. Meaning:
Banana price is 2.2
Range of apples prices:
1
2
3
4
5
6
7
Hence in this case the answer is 2
How I write a function that would return the median apple from that list? And also how do I define the variable define the variable type you would use to accomplish this task.
I am hoping that someone can write just pseudo-code for this function.
Thanks in advance for your reply!