Write a java program to find Distance

Write a Program that accepts four int inputs(x1,y1,x2,y2) as the coordinates of two points. Calculate the distance between the two points using the below formula. Formula : square root of((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2)) Then, Round the result to return an int. Input and Output Format: Input consists of four integers. The output consists of a single integer. Refer

Write a java program to find Largest Difference.

Write a program to read an integer array, find the largest difference between adjacent elements and display the index of largest difference. EXAMPLE: input1: {2,4,5,1,9,3,8} output1: 4 (here largest difference 9-1=8 then return index of 9 ie,4) Input and Output Format: Input consists of an integer n which is the number of elements followed by

Write a java program to find an Unique Number.

Write a program that accepts an Integer as input and finds whether the number is Unique or not. Print Unique if the number is “Unique”, else print “Not Unique”. Note: A Unique number is a positive integer (without leading zeros) with no duplicate digits.For example 7, 135, 214 are all unique numbers whereas 33, 3121, 300

Write a java program to shrink a name.

Write a program that accepts a string as input and converts the first two names into dot-separated initials and print the output. Input string format is ‘fn mn ln’.   Output string format is ‘ln [mn’s 1st character].[fn’s 1st character]’ Input and Output Format: Input consists of a string. The output consists of a String. Refer sample output