

Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
A programming project for csc 127 where students are required to write methods for an arrayfun class to solve various array-related problems. The project involves developing and testing seven methods, including sumgreaterthan, numberofvowels, numberofpairs, stringslongerthan, howmany, sortofsort, and evensleft. Each method is described with an example input and output.
Typology: Exams
1 / 2
This page cannot be seen from the preview
Don't miss anything!


sumGreaterThan( { 1.1, 2.2, 3.3 }, 4.0) true sumGreaterThan( { 1.1, 2.2, 3.3 }, 6.6) false
numberOfVowels({'a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', 'O', 'U', 'x', 'z'}) 10 numberOfVowels( {'y', 'Y' } ) 0 numberOfVowels( {'a', 'X', 'a' } ) 2
numberOfPairs( {"a", "b", "c" } ) 0 numberOfPairs( {"b", "a", "a", "b"} ) 1 numberOfPairs( {"a", "a", "a"} ) 2 numberOfPairs( {"a", "a", "b", "b" } ) 2
stringsLongerThan({"a", "ab", "abc"}, 0) 3 stringsLongerThan({"a", "ab", "abc"}, 2) 1 stringsLongerThan({"a","ab","abc","abcd","abcde","abcdef", "abcdefg"}, 3) 4
howMany( { "A", "a", "A", "a" }, "A") 2 howMany( {"And", "there", "goes", "another"}, "another") 1 howMany( {"And", "there", "goes", "another"}, "Not Here") 0
Original Array Modified Array { 4, 3, 2, 0, 1, 2 } { 0, 3, 2, 1, 2, 4 } { 4, 3, 2, 1 } { 1, 3, 2, 4 } { 1, 3, 2, 4 } { 1, 3, 2, 4 }
Original Array Modified Array {1, 0, 1, 0, 0, 1, 1 } { 0, 0, 0, 1, 1, 1, 1 } {3, 3, 2} { 2, 3, 3 } {2, 2, 2} { 2, 2, 2 }