Percentage of trading in bank between 8:00 to 12:00 is as follows.
8:01 - 9:00 20% [i.e each minute is 1/3 %]
9:01 - 10:00 40% [i.e each minute is 2/3 %]
10:01 - 11:00 30% [i.e each minute is 1/2 %]
11:01 - 12:00 10% [i.e each minute is 1/6 %]
--------------------------------------------------------------------------
Total 100%
Now write an algorithm which will take start time and end time and calculates the % of trading done.
For example:-trading between 8:45 – 9:00 is 15 * 1/3 = 5%
Trading between 8:45 – 11:30 is
15 * 1/3 + 40 + 30 + 30* 1/6 = 80%
I couldn’t said answer then and there, But said my approach as follows.
First I will write a function wich will take start time and end time forms an array as follows [8:45, 9:00, 10:00, 11:00, 11:10]
Then I will write a recursive function will traverse through this array and calculates the total percentages!!!
They are no takers .. any solutions…
8:01 - 9:00 20% [i.e each minute is 1/3 %]
9:01 - 10:00 40% [i.e each minute is 2/3 %]
10:01 - 11:00 30% [i.e each minute is 1/2 %]
11:01 - 12:00 10% [i.e each minute is 1/6 %]
--------------------------------------------------------------------------
Total 100%
Now write an algorithm which will take start time and end time and calculates the % of trading done.
For example:-trading between 8:45 – 9:00 is 15 * 1/3 = 5%
Trading between 8:45 – 11:30 is
15 * 1/3 + 40 + 30 + 30* 1/6 = 80%
I couldn’t said answer then and there, But said my approach as follows.
First I will write a function wich will take start time and end time forms an array as follows [8:45, 9:00, 10:00, 11:00, 11:10]
Then I will write a recursive function will traverse through this array and calculates the total percentages!!!
They are no takers .. any solutions…
Comment