├── Array.java ├── Minimum. ├── Repeat.java ├── Second.java ├── arrayday.java ├── cl.java ├── count (1).java ├── count.java ├── csk.java ├── days.java ├── email.java ├── hw.java ├── ifelse.java ├── lexigoply.java ├── lucas.java ├── middle.java ├── minmax.java ├── palindrome.java ├── pattern.java ├── space.java ├── sum.java ├── sumrow.java ├── trend.java ├── twod.java └── zodiac.java /Array.java: -------------------------------------------------------------------------------- 1 | import java.util.*; 2 | public class Array { 3 | 4 | public static void main(String[] args) { 5 | // TODO Auto-generated method stub 6 | Scanner sc =new Scanner(System.in); 7 | int n =sc.nextInt(); 8 | int a[]= new int[n]; 9 | int min=0; 10 | int max=0; 11 | for(int i=0;imax){ 29 | max=a[i]; 30 | } 31 | } 32 | System.out.println("the max value is:"+max); 33 | 34 | 35 | } 36 | } 37 | 38 | 39 | -------------------------------------------------------------------------------- /Minimum.: -------------------------------------------------------------------------------- 1 | package Day3; 2 | import java.util.*; 3 | public class Minimum { 4 | public static void main(String[] args) { 5 | // System.out.println("Hello World"); 6 | Scanner sc =new Scanner(System.in); 7 | int n =sc.nextInt(); 8 | int a[]= new int[n]; 9 | int min=0; 10 | int max=0; 11 | for(int i=0;imax){ 29 | max=a[i]; 30 | } 31 | } 32 | System.out.println("the max value is:"+max); 33 | 34 | } 35 | } 36 | 37 | 38 | -------------------------------------------------------------------------------- /Repeat.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | import java.util.Scanner; 4 | 5 | public class Repeat { 6 | 7 | public static void main(String[] args) { 8 | // TODO Auto-generated method stub 9 | Scanner sc =new Scanner(System.in); 10 | int n =sc.nextInt(); 11 | int a[]= new int[n]; 12 | for(int i=0;imin){ 27 | max=min; 28 | min=a[i]; 29 | //b[i]=min; 30 | } 31 | } 32 | System.out.println("the min value is:"+max); 33 | 34 | 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /arrayday.java: -------------------------------------------------------------------------------- 1 | package day2; 2 | import java.util.*; 3 | public class arrayday { 4 | 5 | 6 | public static void main(String[] args) { 7 | Scanner sc =new Scanner(System.in); 8 | int n =sc.nextInt(); 9 | int multiply=1; 10 | int a[]=new int[n]; 11 | 12 | for(int i=0;imax){ 31 | max=a[i]; 32 | } 33 | } 34 | System.out.println("the max value is:"+max); 35 | 36 | } 37 | } 38 | 39 | 40 | -------------------------------------------------------------------------------- /palindrome.java: -------------------------------------------------------------------------------- 1 | package day4; 2 | 3 | import java.util.Scanner; 4 | import java.util.*; 5 | 6 | public class palindrome { 7 | 8 | public static void main(String[] args) { 9 | // TODO Auto-generated method stub 10 | Scanner sc =new Scanner(System.in); 11 | String s= sc.nextLine(); 12 | String str1=new StringBuffer(s).reverse().toString(); 13 | //s1.reverse(); 14 | if(s.equalsIgnoreCase(str1)) { 15 | System.out.println("Palidrome"); 16 | 17 | } 18 | else { 19 | System.out.println("not palindrome"); 20 | } 21 | } 22 | 23 | } 24 | -------------------------------------------------------------------------------- /pattern.java: -------------------------------------------------------------------------------- 1 | package day4; 2 | import java.util.*; 3 | public class pattern { 4 | 5 | public static void main(String[] args) { 6 | // TODO Auto-generated method stub 7 | //System.out.println("Hello World"); 8 | Scanner sc=new Scanner(System.in); 9 | int n=sc.nextInt(); 10 | int num=1; 11 | for(int i=1;i<=n;i++){ 12 | for(int j=1;j<=n-i;j++){ 13 | System.out.print(" "); 14 | } 15 | for(int j=1;j<=i;j++) { 16 | System.out.print(i +" "); 17 | } System.out.println(); 18 | } 19 | } 20 | } 21 | 22 | 23 | -------------------------------------------------------------------------------- /space.java: -------------------------------------------------------------------------------- 1 | package day4; 2 | 3 | import java.util.Scanner; 4 | 5 | public class space { 6 | 7 | public static void main(String[] args) { 8 | Scanner sc =new Scanner(System.in); 9 | String s= sc.nextLine(); 10 | String a =s.replace(" ",""); 11 | System.out.println(a); 12 | } 13 | 14 | } 15 | -------------------------------------------------------------------------------- /sum.java: -------------------------------------------------------------------------------- 1 | 2 | import java.util.*; 3 | import java.lang.*; 4 | import java.io.*; 5 | class sum{ 6 | 7 | final static float PIE = 3.14f; 8 | static int s_x, s_y, s_z; 9 | 10 | public static void main(String[] args) { 11 | 12 | int i, N, x, y, z; 13 | int arr[] = new int[50]; 14 | float sum = 0.0f; 15 | Scanner sc = new Scanner(System.in); 16 | 17 | N = sc.nextInt(); 18 | N = 3 * N; 19 | 20 | for(i = 0; i < N; i++){ 21 | arr[i] = sc.nextInt(); 22 | } 23 | 24 | s_x = arr[0]; 25 | s_y = arr[1]; 26 | s_z = arr[2]; 27 | 28 | for(i = 3; i < N ; i += 3){ 29 | sum += shortDist(arr[i], arr[i+1], arr[i+2]); 30 | } 31 | System.out.printf("%.2f", sum); 32 | } 33 | 34 | private static float shortDist(int x, int y, int z) { 35 | 36 | float dis; 37 | // check if the Z-axis and any other one axis are the same. 38 | if(z == s_z && (y == s_y || x == s_x ) && s_z != 0){ 39 | 40 | //check if the x axis of next co-ordinate is same 41 | if(x != s_x){ 42 | dis = (2 * PIE * (Math.abs(x - s_x))) / 6.0f; 43 | } 44 | 45 | //check if the y axis of next co-ordinate is same 46 | else{ 47 | dis = (2 * PIE * (Math.abs(y - s_y))) / 6.0f; 48 | } 49 | } 50 | else{ 51 | dis = (int)(Math.sqrt(Math.pow(x - s_x, 2) + Math.pow(y - s_y, 2)) + Math.abs(z - s_z)); 52 | } 53 | s_x = x; 54 | s_y = y; 55 | s_z = z; 56 | return dis; 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /sumrow.java: -------------------------------------------------------------------------------- 1 | 2 | 3 | import java.util.Scanner; 4 | 5 | public class sumrow { 6 | 7 | public static void main(String[] args) { 8 | // TODO Auto-generated method stub 9 | 10 | Scanner sc =new Scanner(System.in); 11 | int n =sc.nextInt(); 12 | int a[][]= new int[n][n]; 13 | // int sum=0,bot =0; 14 | for(int i=0;i=1&&date<=19){ 17 | System.out.println("capicorn"); 18 | } 19 | else if(date>=20&&date<=31){ 20 | System.out.println("Aquaris"); 21 | } 22 | else{ 23 | System.out.println("Invalid"); 24 | } 25 | } 26 | else if(month==2){ 27 | //System.out.println("B"); 28 | if(date>=1&&date<=18){ 29 | System.out.println("Aquaris"); 30 | } 31 | else if(date>=19&&date<=29){ 32 | System.out.println("Pisces"); 33 | } 34 | else{ 35 | System.out.println("Invalid"); 36 | } 37 | 38 | } 39 | else if(month==3){ 40 | //System.out.println("C"); 41 | if(date>=1&&date<=20){ 42 | System.out.println("Pisces"); 43 | } 44 | else if(date>=21&&date<=29){ 45 | System.out.println("Aries"); 46 | } 47 | else{ 48 | System.out.println("Invalid"); 49 | } 50 | } 51 | else if(month==4){ 52 | //System.out.println("C"); 53 | if(date>=1&&date<=19){ 54 | System.out.println("Aries"); 55 | } 56 | else if(date>=20&&date<=30){ 57 | System.out.println("Tauries"); 58 | } 59 | else{ 60 | System.out.println("Invalid"); 61 | } 62 | } 63 | else if(month==5){ 64 | //System.out.println("C"); 65 | if(date>=1&&date<=20){ 66 | System.out.println("Tauries"); 67 | } 68 | else if(date>=20&&date<=31){ 69 | System.out.println("Gemini"); 70 | } 71 | else{ 72 | System.out.println("Invalid"); 73 | } 74 | } 75 | else if(month==6){ 76 | //System.out.println("C"); 77 | if(date>=1&&date<=21){ 78 | System.out.println("Gemini"); 79 | } 80 | else if(date>=20&&date<=30){ 81 | System.out.println("Cancer"); 82 | } 83 | else{ 84 | System.out.println("Invalid"); 85 | } 86 | } 87 | else if(month==7){ 88 | //System.out.println("C"); 89 | if(date>=1&&date<=22){ 90 | System.out.println("Cancer"); 91 | } 92 | else if(date>=20&&date<=30){ 93 | System.out.println("Leo"); 94 | } 95 | else{ 96 | System.out.println("Invalid"); 97 | } 98 | } 99 | else if(month==8){ 100 | //System.out.println("C"); 101 | if(date>=1&&date<=22){ 102 | System.out.println("Leo"); 103 | } 104 | else if(date>=23&&date<=31){ 105 | System.out.println("Virgo"); 106 | } 107 | else{ 108 | System.out.println("Invalid"); 109 | } 110 | } 111 | else if(month==9){ 112 | //System.out.println("C"); 113 | if(date>=1&&date<=22){ 114 | System.out.println("Virgo"); 115 | } 116 | else if(date>=23&&date<=30){ 117 | System.out.println("Libra"); 118 | } 119 | else{ 120 | System.out.println("Invalid"); 121 | } 122 | } 123 | else if(month==10){ 124 | //System.out.println("C"); 125 | if(date>=1&&date<=22){ 126 | System.out.println("Libra"); 127 | } 128 | else if(date>=23&&date<=31){ 129 | System.out.println("Seorpia"); 130 | } 131 | else{ 132 | System.out.println("Invalid"); 133 | } 134 | } 135 | else if(month==11){ 136 | //System.out.println("C"); 137 | if(date>=1&&date<=22){ 138 | System.out.println("Seorpia"); 139 | } 140 | else if(date>=23&&date<=30){ 141 | System.out.println("Sagattarius"); 142 | } 143 | else{ 144 | System.out.println("Invalid"); 145 | } 146 | } 147 | else if(month==12){ 148 | //System.out.println("C"); 149 | if(date>=1&&date<=22){ 150 | System.out.println("Sagattarius"); 151 | } 152 | else if(date>=23&&date<=31){ 153 | System.out.println("capicorn"); 154 | } 155 | else{ 156 | System.out.println("Invalid"); 157 | } 158 | } 159 | else{ 160 | System.out.println("Invalid month"); 161 | } 162 | } 163 | } --------------------------------------------------------------------------------