Write a java program to find nth number word from the string. Write a program to read a string that contains comma separated fruit names and also a number N. Pick the nth fruit and return it. If the total number of elements is less than the number specified in N, then return the last
Write a java program to find the first and last word in the sentence. Write a program to read a string containing multiple words find the first and last words, if they are same, return the length and if not return the sum of length of the two words. The return type is the length
Java program to check the perfect number. Write a program to that takes a positive integer and returns true if the number is perfect number. A positive integer is called a perfect number if the sum of all its factors (excluding the number itself, i.e., proper divisor) is equal to its value. For example, the
Write a java program to count the number of digits before and after the decimal point. For a given double number with at least one decimal value, Write a program to compute the number of digits before and after the decimal point in the following format – noOfDigitsBeforeDecimal:noOfDigitsAfterDecimal. Note: Ignore zeroes at the end of
Write a java program using Hashmap (Employees & Designations). A Company wants to obtain employees of a particular designation. You have been assigned as the programmer to build this package. You would like to showcase your skills by creating a quick prototype. The prototype consists of the following steps: Read Employee details from the User.
Write a java program to Calculate Grades. A School wants to give assign grades to its students based on their marks. You have been assigned as the programmer to automate this process. You would like to showcase your skills by creating a quick prototype. The prototype consists of the following steps: Read student details from
Write a program to validate the Date of Birth given as input in String format (MM/dd/yyyy) as per the validation rules given below. Return true for valid dates else return false. 1. Value should not be null 2. month should be between 1-12, date should be between 1-31 and year should be a four digit
Write a java program to convert ArrayList to String Array. how to convert ArrayList into the string array in java Write a program that performs the following actions: Read n strings as input. Create an arraylist to store the above n strings in this arraylist. Write a function convertToStringArray which accepts the arraylist as input.
Write a program to generate the state ID. 1)Read n Strings as input(as State Name). 2)Create a String Array to Store the above Input. 3)Write a function getStateId which accepts String Array as input. 4)Create a HashMap<String,String> which stores state name as key and state Id as Value. 5)The function getStateId returns the HashMap to the Main
Write a program that takes two ArrayLists as input and finds out all elements present either in A or B, but not in both. Input and Output Format: Input consists of an integer (m) denoting the size of the first ArrayList. The next m elements would be the values of the first array list. The next