Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In most of these, the method should accept the required pieces of data as arguments and return the result. Input and output should probably

In most of these, the method should accept the required pieces of data as arguments and return the result.

In most of these, the method should accept the required pieces of data as arguments and return the result. Input and output should probably not occur in your solutions; input and output would likely occur in the method that calls your method! 1. Write a method that computes the average of an array of integers. a. A harder version of this problem is to return the median instead. 2. Write a method that returns the 4th largest of an array of integers. 3. Write a method that will encrypt a string using the Caesar encryption method. The encryption method requires a key (an integer between 0 and 25 or -1 to-25). This key is the amount to shift each letter in the string; other symbols remain unaffected. For example, if the string were "silly words. 12 of them." and the key were 2 then the encrypted string would be "uknna yqtfu. 12 qh vigo." Notice that if the shift goes beyond the letter 'z' then you wrap around to "a" again. 4. Write a method to determine if a string is a palindrome. A palindrome is a phrase that when spelled backwards is the same as forwards. Note: How to handle punctuation? Write a method that determines if a number is a palindrome. Note: do not use strings. Write a method that will compute the next value in a funny mathematical series. The next value in the series is the sum of the squares of the digits of the current value in the series. For example, if the current value is 89 then the next value is 8+92-145. 5. 6. 7. Write a method that returns the distinct characters that can be found in a string argument. a. Variations to this question include: returning how many distinct characters instead and making your solution case insensitive. 8. Write a method that accepts two strings as parameters and returns a third string containing the characters that are in the first string but not in the second. First String Second String " "abba "silly" "what" "silly" "ice" "silly" "ice "cat" "dog" 9. Write a method that accepts two strings as parameters and returns a count of the number of characters that are in the first string but not the second string. First String Second String "bill" "abba" "silly" "bill" FFF "what" "silly" "ice "cat" 11 "bill" "bill" *** "ice" "silly" "dog Result waa 11 11 -11 "what" "slly" ce" cat" Result 2 2 4 4 2 10. Solve questions 8 and 9 again, but this time make sure that all of the characters are distinct.

Step by Step Solution

3.44 Rating (154 Votes )

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Principles of Auditing and Other Assurance Services

Authors: Ray Whittington, Kurt Pany

19th edition

978-0077804770, 78025613, 77804775, 978-0078025617

Students also viewed these Programming questions

Question

If y=tan-13/t^2 find dy/dt

Answered: 1 week ago

Question

What does he "expectancy" concept in Expectancy Theory refer to

Answered: 1 week ago

Question

Service departments are those departments which:

Answered: 1 week ago