Python - Computer Science Assessment Answer
Assignment Task:
TV Shows
A TV station is broadcasting two series (Series A and Series B) in the next season. In the previous seasons, on the sixth Sunday, the sixth episode of series A and the sixth episode of series B was broadcasted.
However, some episodes are good, and some episodes are bad. The marketing research team has found that the viewers are much more satisfied if they watch two good episodes on one day and two bad episodes next week than if they watch one good episode and one bad episode on both days. Thus, the managers have decided to change the broadcasting order a bit. While each series must be broadcasted in order, it is still possible to change the sequence a bit -- instead of airing one episode of A and episode of B, it is possible to air two episodes of A or two episodes of B.
Each episode of each series has a rating (0-100). When two episodes with ratings rand s are aired together, the viewer satisfaction equals rs; the total satisfaction is obtained by adding the viewer satisfaction for each week. Given the sequences of ratings, your task is to find the broadcasting sequence which will make the viewers most satisfied.
For example, suppose that the ratings of episodes of A are [53,20,50,22,63,43,43,39,83,76], and the ratings of episodes of B are [73,83,10,23,34,24,0,77,33,32]. By broadcasting i-th episode of A and i-th episode of B on i-th sunday, the total viewer satisfaction is 53*73+20*83+...+76*23 = 17883. However, if we broadcast epsiodes [B0,B1] the first week, [B2,B3] the second week, [A0,B4] the third week, then [B5,B6], [B7,B8], [A1,B9], [A2,A3], [A4,A5], [A6,A7], [A8,A9], the total viewer satisfaction is 73 * 83 + 10 * 23 + 53 * 34 + 24 * 0 + 77 * 33 + 20 * 32 + 50 * 22 + 63 * 43 + 43 * 39 + 83 * 76 = 23066.
Your task is to write a program which, given the two rating sequences, finds the highest possible total viewer satisfaction. For simplicity, it is enough to output only this highest value (you are not required to output the optimal sequence itself).
This Computer Science Assessment has been solved by our Computer Science experts at My Uni Paper. Our Assignment Writing Experts are efficient to provide a fresh solution to this question. We are serving more than 10000+ Students in Australia, UK & US by helping them to score HD in their academics. Our Experts are well trained to follow all marking rubrics & referencing style.