![]() Write a Java method that accept three integers and check whether they are consecutive are not. The integer may be assumed to be non-negative. Write a Java method to count the number of digits in an integer that have the value 2. Write a Java method to find all twin prime numbers less than 100. Go to the editorĮxpected Output: Current date and time: Wednesday Janu7:47:43ġ6. Write a Java method to display the current date and time. Go to the editorĮxpected Output: Input the number of sides: 5 Write a Java method to create the area of a pentagon. Write Java methods to calculate the area of a triangle. Write a Java method (takes a number n as input) to displays an n-by-n matrix. Input a password (You are agreeing to the above Terms and Conditions.): abcd1234ġ2. A password must contain at least two digits A password consists of only letters and digits.ģ. A password must have at least eight characters.Ģ. Go to the editorĪ password must have at least ten characters.Ī password consists of only letters and digits.Ī password must contain at least two digits.Įxpected Output: 1. Write a Java method to check whether a string is a valid password. Write a Java method to check whether a year (integer) entered by the user is a leap year or not. Go to the editorĮxpected Output: ( ) * +,. Write a Java method to print characters between two characters (i.e. Sample data (Monthly compounded) and Output:ĩ. ![]() Write a Java method to compute the future investment value at a given interest rate for a specified number of years. 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.Įxpected Output: 1 5 12 22 35 51 70 92 117 145ġ426 1520 1617 1717 1820 1926 2035 2147 2262 2380Ģ501 2625 2752 2882 3015 3151 3290 3432 3577 3725Ĩ. Write a Java method to display the first 50 pentagonal numbers. Write a Java method to compute the sum of the digits in an integer. Input the string: The quick brown fox jumps over the lazyĮxpected Output: Number of words in the string: 9Ħ. ![]() Write a Java method to count all words in a string. Go to the editorĮxpected Output: Number of Vowels in the string: 4ĥ. Write a Java method to count all vowels in a string. Note: a) If the length of the string is odd there will be two middle characters.ī) If the length of the string is even there will be one middle character.Ĥ. Write a Java method to display the middle character of a string. Go to the editorĮxpected Output: The average value is 45.0ģ. Write a Java method to compute the average of three numbers. Go to the editorĮxpected Output: The smallest value is 25.0Ģ. ![]() Write a Java method to find the smallest number among three numbers. ![]()
0 Comments
Leave a Reply. |