(Solved) : This is an Individual Challenge. You must work alone to solve . . .
This is an Individual Challenge. You must work alone to solve this problem. You may not collaborate or share work with other students. Everything you need to know to solve this problem has been covered in the course materials prior to this challenge. Review those materials to refresh your memory and to find things you might have missed. Do not use any language or library features that have not been specifically covered in the prior course materials. Problem Description and Given Info Write (define) a public static method named getSmallest, that takes three arguments (all arguments will be ints). When this method is called, it should return (as an int) the smallest of the three arguments passed to it. Examples: get Smallest(0, 0, 0) will return getSmallest(2, 1, 3) will return 1 getSmallest(100, 13, 7) will return 7 You may wish to write some additional code to test your method. 266606.2215050.qx3zqy7 LAB ACTIVITY 10.1.1: Smallest (Java) Individual Challenge 0/10 Main.java Load default template… 1 public class Main { public static void main(String[] args) { // you may wish to write some code in this main method // to test your method. } 9) 10.2 Longest(Java) Individual Challenge This is an Individual Challenge. You must work alone to solve this problem. You may not collaborate or share work with other students. Everything you need to know to solve this problem has been covered in the course materials prior to this challenge. Review those materials to refresh your memory and to find things you might have missed. Do not use any language or library features that have not been specifically covered in the prior course materials. Problem Description and Given Info Write (define) a public static method named longest that takes two arguments (all arguments will be strings). When this method is called, it should determine which string is longer, and return that string. If both arguments are the same length, then this method should return the first argument string. Examples: longest(“abc”, “ab”) longest (“hello”, “goodbye”) longest (“thursday”, “12345678”) will return will return will return “abc” “goodbye” “thursday” You may wish to write some additional code to test your method. Hints: Remember that you can call the length method on a string object, to get the number of characters in that string. For example, given the following declaration and initialization String name = “Bob Smith”; int charCount = name.length(); the above line would store the value 9 in the variable charCount, because there are 9 characters in the string “Bob Smith”. 2666062215050.qx3zay7 LAB ACTIVITY 10.2.1: Longest(Java) Individual Challenge 0/10 Main.java Load default template… nmin 000) 2 3 4 5 6 7 8 1 public class Main { public static void main(String[] args) { // you may wish to write some code in this main method // to test your method. } 9) 10.3 Is Sorted (Java) Individual Challenge This is an Individual Challenge. You must work alone to solve this problem. You may not collaborate or share work with other students. Everything you need to know to solve this problem has been covered in the course materials prior to this challenge. Review those materials to refresh your memory and to find things you might have missed. Do not use any language or library features that have not been specifically covered in the prior course materials. Problem Description and Given Info Write (define) a public static method named issorted that takes three arguments (all arguments will be ints). This method should determine if the three argument values are in ascending order. The method should return the boolean value true if the argument values are in ascending order, otherwise it should return false. Examples: issorted(1, 2, 3) issorted (2, 3, 1) issorted (2, 3, 3) will return will return true false true will return You may wish to write some additional code to test your method. 266606.2215050.qx3zQy7 LAB ACTIVITY 10.3.1: Is Sorted (Java) Individual Challenge 0/10 Main.java Load default template… 2 3 4 min 00 0 1 public class Main { public static void main(String[] args) { // you may wish to write some code in this main method // to test your method. 5 } 6 7
Expert Answer
import java.util.*;
public class Main
{