Daily Task Sheet
Daily Task Sheet
IF ELSE STATEMENTS.
49. Suppose that score is a variable of type double. Write the java statement that
increases the score by 5 marks if score is between 80 and 90
50. Write a java statement that prints true if x is an odd number and positive
51. Write a java statement that prints true if both x and y are positive numbers
52. Write a java statement that prints true if x and y have the same sign (-/+)
53. Write the java statement that assigns 1 to x if y is greater than 0
54. Take values of length and breadth of a rectangle from the user and check if it
is square or not.
55. Take two int values from the user and print greatest among them.
56. A shop will give a discount of 10% if the cost of the quantity purchased is
more than 1000.
Ask users for their salary and year of service and print the net bonus amount.
58. A school has the following rules for the grading system:
a. Below 25 - F
b. 25 to 45 - E
c. 45 to 50 - D
d. 50 to 60 - C
e. 60 to 80 - B
f. Above 80 - A
Ask the user to enter marks and print the corresponding grade.
59. Take input of age of 3 people by the user and determine oldest and youngest
among them
60. A student will not be allowed to sit in an exam if his/her attendance is less
than 75%.
61. Ask user to enter age, sex ( M or F ), marital status ( Y or N ) and then using
following rules print their place of service.
If the employee is female, then she will work only in urban areas.
Basic program:
Array programs
1. Program to print array at odd position.
2. Program to print to copy an array.
3. Program to print array in decending order.
4. Program to print array in ascending order.
5. Program to print frequency of an array.
6. Program to print array at even position.
7. Program to print biggest array value.
8. Program to print duplicate array.
9. Program to print even array element.
10. Program to print odd array element.
11. Program to print array
12. Program to print reverse array.
13. Program to print second largest array element.
14. Program to print third largest array element.
15. Program to print smallest array element.
16. Program to print number of element.
17. Program to print sum of array element.
Mathematics:
1. Write a java program to find Area of Circle.
30. Java program to check if given three side lengths can make a triangle or
not.
Basic Program:
12. Write a java program to check whether java is installed on your computer.
13. Write a java program to count the letters, spaces, numbers and other characters
of an input string.
14. Write a java program to create and display a unique three digit number using
1,2,3,4.Also count how many three digit numbers are there.
15. Write a java program to print the ascii value of a given character.
16. Write a java program that accepts an integer(n) and compute the value of n + nn
+ nnn.
17. Write a java program to print the odd number from 1 to 99.
18. Java program to check the number is even or not print 1 if the n is even or 0 if
the n is odd.
19. Java program to print numbers between 1 to 100 which are divisible by 3,5 and
by both.
21. Java program to check if a given string has all unique characters.
24. Java program that reads an integer between 0 & 1000 and adds all the digits in
the integer.
25. Java program that keeps a number from the user and generates an integer
between 1 and 7 and displays the name of the weekday.
47. Write a Java program to convert all the characters in a string to uppercase .
48. Write a Java program to find the longest Palindromic Substring within a string.
50. Write a java program to print all permutations of a given with repetition.
51. Write a java program to print after removing duplicates from a given string.
52. Write a java program to find non repeating characters in a given string.
54. Write a Java program to find the maximum occurring character in a string.
Collection:.
1. Java program to create Array List.
17. Java program to print all the elements in an array list using the position of the array.
22. Java program to insert the specified element at the specified position in the linked list.
23. Java program to insert in linked list at first and last position.
25. Java program to insert in the last position of the linked list.
26. Java program to get the first and last occurrence of the specific element.
29. Java program to remove the first and last element in the linked list.
34. Java program to check if elements are present in the linked list or not.
35. Java program to remove elements and return the first element of the linked list.
49. Java program to add one tree set to another tree set.
51. Java program to get the first and last element in the tree set.
53. Java program to get the element from a tree set which is greater than or equal to another
element.
54. Java program to get the element from a tree set which is less than or equal to another
element.
55. Java program to remove the first element from the tree set.
63. Java program to copy one tree nap to another tree map.
69. Java program to show in tree map first and last entry.
70. Java program to get the first or lowest and last or highest element in a tree map.
I/O:
1. Java program to copy commands.
2. Java program to copy images.
Array:
1. 1. Java program to sort arrays.
2. 2. Java program to find sum of arrays.
3. 3. Java program to find the average of arrays.
4. 4. Java program to test if an array contains value or not.
5. 5. Java program to find an index of an array.
6. 6. Java program to find specific elements of an array.
7. 7. Java program to copy arrays by iterating.
8. 8. Java program to insert an element in an array.
9. 9. Java program to reverse an array.
10. 10. Java program to find duplicate values in an array of integer values.
11. 11. Java program to find duplicate values in an array of string values.
12. 12. Java program to find common element strings between two arrays.
13. 13. Java program to find common element integers between two arrays.
14. 14. Java program to find the second largest element in an array.
15. 15. Java program to find the second smallest element in an array.
16. 16. Java program to find sum of two matrices.
17. 17. Java program to convert array to array list.
18. 18. Java program to convert array list to array.
19. 19. Java program to find all pairs of elements in an array whose sum is equal to a specific
number.
20. 20. Java program compares two arrays equality.
21. 21. Java program to find missing numbers in an array.
22. 22. Java program to find the number of even or odd numbers in an array.
23. 23. Java program to find differences between highest and lowest numbers.
24. 24. Java program to find the average of numbers accepting the highest and lowest number in
an array.
25. 25. Java program to check if an array without 0 and -1.
26. 26. Java program to check if an array contains two specific numbers or not.
27. 27. Java program to remove duplicate elements in an array.
28. 28. Java program to cyclic rotate array clockwise by one.
29. 29. Java program to find the index of two elements whose sum is integer in an array.
30. 30. Java program to find leaders of an array.
31. 31. Java program to find the sum of two elements is the minimum in the array.
32. 32. Java program to check the maximum product of two elements in an array.
33. 33. Java program to find all unique triplets such that sum of all the three elements equal to a
specific.
34. 34. Java program to find a sum of four elements which is equal to a specific target element.
35. 35. Java program to print the contents of two Dimensional Boolean arrays where t will
present for true and f will present for false.
36. 36. Java program to print an array after changing row and column in array.
37. 37. Java program to find the smallest element in an array.
38. 38. Java program to find the kth largest element in a given array.
39. 39. Java program to find the numbers greater than the average of the number in a given
array.
40. 40. Java program to prove that Euclid's algorithm computes that greatest common divisor of
two positive numbers.
41. 41. Java program to create two D arrays that A[i][j] is true if I j are prime or have common
factors.
42. 42. Java program to divide two given integers using a subtraction operator.
43. 43. Java program to move every positive number to the right and every negative number to
the left in an array.
44. 44. Java program to move each zero to the right side in the array.
45. 45. Java program to multiply two given Integer without using *operator.
46. 46. Java program to length of the longest consecutive sequence of a given array.
47. 47. Java program to partition a given array of integer even or odd numbers.
48. 48. Java program to find the index of the first non repeating character in an array.
49. 49. Java program to find the missing string from two given strings.
50. 50. Java program to find the index of a prime number .
51.