Question: 1. a Java method to find the smallest number among three numbers.. Test Data: Input the first number: 25 Input the Second number: 37 Input

1. a Java method to find the smallest number among three numbers.. Test Data: Input the first number: 25 Input the Second number: 37 Input the third number: 29 Expected Output: The smallest value is 25.0 . 2. a Java method to compute the average of three numbers.. Test Data: Input the first number: 25 Input the second number: 45 Input the third number: 65 Expected Output: The average value is 45.0 . 3. a Java method to display the middle character of a string.. Note: a) If the length of the string is odd there will be two middle characters. b) If the length of the string is even there will be one middle character. Test Data: Input a string: 350 Expected Output: The middle character in the string: 5 . 4. a Java method to count all vowels in a string.. Test Data: Input the string: w3resource Expected Output: Number of Vowels in the string: 4 . 5. a Java method to count all words in a string.. Test Data: Input the string: The quick brown fox jumps over the lazy dog. Expected Output: Number of words in the string: 9 . 6. a Java method to compute the sum of the digits in an integer.. Test Data: Input an integer: 25 Expected Output: The sum is 7 . 7. a Java method to display the first 50 pentagonal numbers.. Note: A pentagonal number is a figurate number that extends the concept of triangular and square numbers to the pentagon, but, unlike the first two, the patterns involved in the construction of pentagonal numbers are not rotationally symmetrical. Expected Output: 1 5 12 22 35 51 70 92 117 145 176 210 247 287 330 376 425 477 532 590 651 715 782 852 925 1001 1080 1162 1247 1335 1426 1520 1617 1717 1820 1926 2035 2147 2262 2380 2501 2625 2752 2882 3015 3151 3290 3432 3577 3725 . 8. a Java method to compute the future investment value at a given interest rate for a specified number of years.. Sample data (Monthly compounded) and Output: Input the investment amount: 1000 Input the rate of interest: 10 Input number of years: 5 Expected Output: Years FutureValue 1 1104.71 2 1220.39 3 1348.18 4 1489.35 5 1645.31 . 9. a Java method to print characters between two characters (i.e. A to P ).. Note: Prints 20 characters per line Expected Output: ( ) * + , - . / 0 1 2 3 4 5 6 7 8 9 : ; < = > ? @ A B C D E F G H I J K L M N O P Q R S T U V W X Y Z [ \ ] ^ _ ` a b c d e f g h i j k l m n o p q r s t u v w x y z . 10. a Java method to check whether a year (integer) entered by the user is a leap year or not.. Expected Output: Input a year: 2017 false . 11. a Java method to check whether a string is a valid password.. Password rules: A password must have at least ten characters. A password consists of only letters and digits. A password must contain at least two digits. Expected Output: 1. A password must have at least eight characters. 2. A password consists of only letters and digits. 3. A password must contain at least two digits Input a password (You are agreeing to the above Terms and Conditions.): abcd1234 Password is valid: abcd1234 . 12. a Java method (takes a number n as input) to displays an n-by-n matrix.. Expected Output: Input a number: 10 1 0 0 1 1 0 0 0 1 1 0 0 1 0 1 0 1 0 0 0 0 1 0 1 0 0 0 0 0 1 1 1 1 0 0 0 0 1 1 1 1 1 0 1 1 1 0 1 0 0 1 0 0 0 1 1 0 0 0 0 0 0 1 0 0 0 0 1 1 1 1 1 0 1 0 1 0 0 1 0 0 0 1 0 0 0 0 1 1 0 1 1 1 0 0 1 1 1 1 0 . 13. Java methods to calculate the area of a triangle.. Expected Output: Input Side-1: 10 Input Side-2: 15 Input Side-3: 20 The area of the triangle is 72.6184377413890 . 14. a Java method to create the area of a pentagon.. Expected Output: Input the number of sides: 5 Input the side: 6 The area of the pentagon is 61.93718642120281 . 15. a Java method to display the current date and time.. Expected Output: Current date and time: Wednesday January 25, 2017 7:47:43 . 16. a Java method to find all twin prime numbers less than 100.. Expected Output: (3, 5) (5, 7) (11, 13) (17, 19) (29, 31) (41, 43) (59, 61) (71, 73)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!