Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please use Java, Thank you. 6-1 So far in this course, all of your programs have been written to be fully contained inside a single

Please use Java, Thank you. 6-1
image text in transcribed
image text in transcribed
image text in transcribed
So far in this course, all of your programs have been written to be fully contained inside a single method named main. The main method is where Java begins execution of your program. In this assignment, you will be coding cther methods in addition to the main method. These additional methods will perform specific functions and, in most cases, return results. Write all your methods in a class named Homework6Methods.java 1. Write a public static method named getMaxOf2Ints that takes in 2 int arguments and returns the Maximum of the 2 values 2. Write a public static method named getMinOf2Ints that takes in 2 int arguments and returns the Minimum of the 2 values 3. Write a public static method named getMaxOf3Ints that takes in 3 int arguments and returns the Maximum of the 3 values 4. Write a public static method named getMedianOf3Ints that takes in 3 int arguments and returns the Median Value of the 3 values 5. Write a public static method named printMinOf3Ints that takes in 3 int arguments of type int and prints the minimum value of those 3 ints Example: "The min is " + minVal 6. Write a public static method named getProdOfAllPositivelnts that takes in 1 int argument and returns the product of all the values between 1 and that number. If the argument is NON-positive return 0 7. Write a public static method named getProdOfAllNegativelnts that takes in 1 int argument and returns the product of all the values between 1 and that number. If the argument is NON-negative return 0 8. Write a public static method named isProdOfAllNegativelntsNegative that takes in 1 int argument and returns true if the product of all the values between 1 and that number is negative, and false otherwise. 9. Write a public static method named getCharAtindex that takes in 2 arguments, a String s, and an int index. The method should return the char found at the index location of the string or if not found return a ' ? ' 10. Write a public static method named getCountOfCharInString that takes in 2 arguments, a String s, and a char c. The method should return an int representing the number of times the char was found within the string. 11. Write a public static method named getStringReversed that takes in 1 argument of type String and returns the String in reverse order. 12. Write a public static method named getString TitleCased that takes in 1 argument of type String and capitalizes the first letter of each word in the String, then returns the title cased string. Special cases (error checking): - If the string is null, the method should return a blank string, "". - If the string is the blank string, ", the method should return the blank string. - If the length of the string is 0 , the method should return a blank string. 2. Write a public static method named getStringTitleCased that takes in 1 argument of type String and capitalizes the first letter of each word in the String, then returns the title cased string. Special cases (error checking): - If the string is null, the method should return a blank string, "". - If the string is the blank string, "", the method should return the blank string. - If the length of the string is 0 , the method should return a blank string

Step by Step Solution

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

The Manga Guide To Databases

Authors: Mana Takahashi, Shoko Azuma, Co Ltd Trend

1st Edition

1593271905, 978-1593271909

More Books

Students also viewed these Databases questions