Write a java program to calculate median of the array. Write a program to accept an int array as input, and calculate the median of the same. Median Calculation Procedure: Sort the sequence of numbers. The total number count is odd, Median will be the middle number. The total number count is even, Median will
Write a java program to count the word occurrences in the string. Write a program to read a string that contains a sentence and read a word. Check the number of occurrences of that word in the sentence. Note: The check is case-sensitive. Input and Output Format: Input consists of two strings. The output consists
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.