Untitled
unknown
plain_text
5 years ago
1.4 kB
9
Indexable
/**
*
* @return an array representing the number of views as a percentage
* of total views.
* for example, if views = {10, 70, 20, 90}, the total views are 190.
* 10 is 5.26% of 190
* 70 is 36.84% of 190
* 20 is 10.52% of 190
* 90 is 47.36% of 190
* Don't worry about the EXACT value. The test checks if each value is
* within 0.01 of the value expected
* return null if views is null and empty array if views is an empty array
*/
public double[] viewsInPercentage() {
return null;
}
/**
* return a String representation of the calling object of the form:
*
* Title
* Day 1 views: <day 1 views>
* Day 2 views: <day 2 views>
* ...
*
* (special case for when views is null or empty)
*
* For example,
*
* if title = "Intro" and views = {10, 70, 20, 90}, return
*
* "Intro
* Day 1 views: 10
* Day 2 views: 70
* Day 3 views: 20
* Day 4 views: 90"
*
* return the String "Intro - No Views Yet" if title = "Intro" and views is null or empty
*/
public String toString() {
return ""; //to be completed
}
/**
*
* @return the length of the longest sequence where
* each item is strictly more than the item before it.
* return 0 if views is null or empty
*/
public int maxLengthIncreasingViews() {
return 0; //to be completed
}
Editor is loading...