about | help | code help+videos | done | prefs |
It is almost Thanksgiving Day! That means we will be eating a bunch of turkey! Write a method that has an integer array as an input parameter. The array contains the number of slices of turkey you eat each day. The array can be any length, however, none of the elements will be negative. You are considered to have "stuffed yourself" with turkey if you ate more than 15 slices total, or if you ate more than 5 slices in one day. Write a method that returns true if you "stuffed yourself" or false otherwise. piggy([3, 4, 1, 1, 0, 4, 2, 0]) → false piggy([1, 0, 1, 2, 1, 5, 3, 1]) → false piggy([2, 6, 0]) → true ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Difficulty: 220
Copyright Nick Parlante 2017 - privacy