Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //////////////////////////////////////////////////////////////////////////////////////////////////////////
- PEREK 1
- \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
- TARGIL 1
- package com.company;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner s = new Scanner(System.in);
- double radios;
- System.out.println("give me a radios");
- radios=s.nextDouble();
- System.out.println("circumference of the circle:"+(2*radios*3.14));
- System.out.println("space of circle:"+(3.1415*radios)*(3.1415*radios));
- }
- }
- ////////////////////////////////////////////////////////////////////////////////////////
- TARGIL 2
- package com.company;
- import java.util.Scanner;
- public class Main
- {
- public static void main(String[] args)
- {
- Scanner s = new Scanner(System.in);
- System.out.println();
- final int TOST=12,EX1=2,EX2=3;
- int num1,num2;
- System.out.println("how much cheap extra you want?/corn/olives");
- num1=s.nextInt()*EX1;
- System.out.println("how mum exepensive extras you want?/cheese/mushrooms");
- num2=s.nextInt()*EX2;
- System.out.println("you need to pay:"+(TOST+num1+num2));
- }
- }
- ////////////////////////////////////////////////////////////////////////////////////////////
- TARGIL 3
- package com.company;
- import java.util.Scanner;
- public class Main
- {
- public static void main(String[] args)
- {
- Scanner s =new Scanner(System.in);
- final int DELIVERY=5,FLOOR=1;
- final double TIP=0.1;
- int kg,km,price,floor,cost;
- System.out.println("what price of the product?");
- price=s.nextInt();
- System.out.println("how much km of delivery? which floor? and how many kg's?");
- km=s.nextInt();
- floor=s.nextInt();
- kg=s.nextInt();
- cost= (int) (price*TIP+FLOOR*kg*floor+km*DELIVERY+price);
- System.out.println(cost);
- }
- }
- \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
- PEREK 2
- ////////////////////////////////////////////////////////////////////////////////////////////
- TARGIL 1
- package com.company;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner s= new Scanner(System.in);
- final int age=18;
- int num;
- System.out.println("what is your age");
- num=s.nextInt();
- System.out.println(num>18?"your old":"your a child");
- }
- }
- ///////////////////////////////////////////////////////////////////////////////////////////////////
- PEREK 2 TARGIL 2
- package com.company;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner s= new Scanner(System.in);
- final int age=18;
- int num;
- System.out.println("what is your age");
- num=s.nextInt();
- if (num>age&&num<65)
- {
- System.out.println("your a man");
- }
- if (num>=65)
- {
- System.out.println("pansioner");
- }
- if(num<18) {
- System.out.println("your a child");
- }
- }
- }
- ///////////////////////////////////////////////////////////////////////////////////////
- TARGIL 3
- package com.company;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner s = new Scanner(System.in);
- int num;
- System.out.println("please give me a num bigger than 10");
- num = s.nextInt();
- System.out.println(num % 10 == num /10 ? "the same num's" : "not the same");
- }
- }
- ///////////////////////////////////////////////////////////////////////////////////////////////
- TARGIL 4
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner s = new Scanner(System.in);
- int num,temp,num1,num2,num3;
- boolean isSame=false;
- System.out.println("please give me a num bigger than 99");
- num = s.nextInt();
- temp=num;
- num1=temp%10;
- temp/=10;
- num2=temp%10;
- num3=temp/10;
- isSame=num1==num2 && num2==num3;
- System.out.println("the number is "+(isSame?"":"NOT")+" same");
- }}
- ////////////////////////////////////////////////////////////////////////////////////////////////////
- TARGIL 5
- package com.company;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args) {
- Scanner s = new Scanner(System.in);
- int num;
- System.out.println("please give me a num bigger than 99");
- num = s.nextInt(); //45
- System.out.println(num%10==(num/10+1)?"follow num's":"not follow");// 4+1=5
- }}
- //////////////////////////////////////////////////////////////////////////////////////////////////////
- TARGIL 6
- package com.company;
- import java.util.Scanner;
- public class Main
- {
- public static void main(String[] args)
- {
- Scanner s = new Scanner(System.in);
- int num,temp,num1,num2,num3;
- boolean isfollow;
- System.out.println("please give me a num bigger than 99");
- num = s.nextInt();
- temp=num;
- num1=temp/100;
- num2=(temp/10)%10;
- num3=temp%10;
- isfollow=num1+2==num2+1&&(num2+1)==num3;
- System.out.println("the num's is:"+(isfollow?"":"NOT")+" "+"FOLLOW");
- }
- }
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////
- TARGIL 7
- package com.company;
- import java.util.Scanner;
- public class Main
- {
- public static void main(String[] args)
- {
- Scanner s = new Scanner(System.in);
- final double FUEL=0.15;
- double full,gas;
- System.out.println("how much you have in the tank?");
- full=s.nextDouble();
- System.out.println("how much litters gas did you really have?");
- gas=s.nextDouble();
- System.out.println(FUEL*full<gas?"you can drive":"go to gas station!");
- }
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- TARGIL 8
- public class Main {
- public static void main(String[] args)
- {
- Scanner s=new Scanner(System.in);
- int runnerA;
- System.out.println("how many minutes do you think you'll finish the race?");
- runnerA=s.nextInt();
- if (runnerA<=50)
- {
- System.out.println("run in A run");
- }
- if (runnerA>=50&&runnerA<=60)
- {
- System.out.println("run in B run");
- }
- if (runnerA>60)
- {
- System.out.println("run in C run fat mann!!");
- }
- }
- }
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- TARGIL 9
- package com.company;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args)
- {
- Scanner s = new Scanner(System.in);
- int num,num1,num2,num3,temp;
- System.out.println("please enter your date");
- num=s.nextInt();
- temp=num;
- num1=temp%10000;
- temp/=10000;
- num2=temp%100;
- temp/=100;
- num3=temp%100;
- temp/=10;
- System.out.println("the year"+num1+"your month:"+num2+"your day:"+num3);
- }
- }
- /////////////////////////////////////////////////////////////////////////////////////////////////////
- TARGIL 10
- package com.company;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args)
- {
- Scanner s = new Scanner(System.in);
- int num,num1,num2,num3,temp;
- System.out.println("please enter date");
- num=s.nextInt();
- temp=num;
- num1=temp%10000;
- temp/=10000;
- num2=temp%100;
- temp/=100;
- num3=temp%100;
- temp/=10;
- if (num2>=3&&num2<=5)
- {
- System.out.println("your season is aviv");
- }
- if (num2>=6&&num2<=8)
- {
- System.out.println("your season is summer");
- }
- if (num2>=9&&num2<=11)
- {
- System.out.println("your season is stav");
- }
- if (num2>=12&&num2<=2)
- {
- System.out.println("your season is horef");
- }
- }
- }
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////
- PEREK 3
- \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
- TARGIL 1
- package com.company;
- import java.util.Scanner;
- public class Main
- {
- public static void main(String[] args)
- {
- Scanner s = new Scanner(System.in);
- int num = 0, counter = 0;
- while (counter < 5)
- {
- System.out.println("please enter num's");
- num = s.nextInt();
- if (num % 2 == 0)
- {
- counter++;
- }
- }
- System.out.println("its ok!!! five num's even");
- }
- }
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- TARGIL 2
- package com.company;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args)
- {
- Scanner s = new Scanner(System.in);
- int num = 0, counter = 0;
- System.out.println("please enter ten num's");
- for (int i=0;i<10;i++)
- {
- num=s.nextInt();
- if (num%2!=0)
- {
- counter++;
- }
- }
- System.out.println("you put:"+counter+" odd num's");
- }
- }
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////
- TARGIL 3
- public class Main {
- public static void main(String[] args)
- {
- Scanner s = new Scanner(System.in);
- char letters;
- int counter=0;
- System.out.println("put some char's");
- for (int i=0;i<10;i++)
- {
- letters=s.next().charAt(0);
- if (letters>='A'&&letters<='Z')
- {
- counter++;
- }
- }
- System.out.println("you put:"+counter+" big letters");
- }
- }
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////
- TARGIL 4
- package com.company;
- import java.util.Scanner;
- public class Main {
- public static void main(String[] args)
- {
- Scanner s = new Scanner(System.in);
- char letters;
- int counter=0;
- System.out.println("put some char's");
- for (int i=0;i<10;i++)
- {
- letters=s.next().charAt(0);
- if (letters>='a'&&letters<='z')
- {
- counter++;
- }
- }
- System.out.println("you put:"+counter+" small letters");
- }
- }
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- TARGIL 5
- package com.company;
- import java.util.Scanner;
- public class Main
- {
- public static void main(String[] args)
- {
- Scanner s = new Scanner(System.in);
- int num,counter=0;
- System.out.println("put some num's");
- while (counter<1)
- {
- num = s.nextInt();
- if (num % 10 == num / 10)
- {
- counter++;
- }
- }
- System.out.println("you put the same nums");
- }
- }
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////
- TARGIL 6
- package com.company;
- import java.util.Scanner;
- public class Main
- {
- public static void main(String[] args)
- {
- Scanner s = new Scanner(System.in);
- int num,counter=0;
- System.out.println("put some num's");
- while (counter<1)
- {
- num = s.nextInt();
- if (num % 10 == num / 10)
- {
- counter++;
- }
- }
- System.out.println("you put the same nums");
- }
- }
- /////////////////////////////////////////////////////////////////////////////////////////////////////////////
- TARGIL 7
- package com.company;
- import java.util.Scanner;
- public class Main
- {
- public static void main(String[] args)
- {
- Scanner s = new Scanner(System.in);
- int num,counter=0;
- System.out.println("put some num's");
- while (counter<1)
- {
- num = s.nextInt();
- if (num % 7 == 0&&num>99&&num<999)
- {
- counter++;
- }
- }
- System.out.println("7 BOOM SHAKA LUCK");
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- TARGIL 8
- package com.company;
- import java.util.Scanner;
- public class Main
- {
- public static void main(String[] args)
- {
- Scanner s = new Scanner(System.in);
- int num, counter = 0;
- System.out.println("put a num");
- num = s.nextInt();
- for (int i=1;i<=num;i+=1)
- {
- System.out.print(i%7==0?" BOOM ":i+" ");
- }
- }
- }
- //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- PEREK 2 C
- \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
- TARGIL 1
- public class Main {
- public static void main(String[] args)
- {
- Scanner s= new Scanner(System.in);
- int[]arr=new int[10];
- boolean eveNums=false;
- System.out.println("enter ten num's");
- for (int i=0;i<arr.length;i++)
- {
- arr[i]=s.nextInt();
- }
- for (int i=0;i<arr.length;i+=1)
- {
- eveNums=arr[i]%2==0;
- if (eveNums)
- {
- System.out.println(arr[i]);
- }
- }
- }
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- TARGIL 2
- public class Main {
- public static void main(String[] args) {
- Scanner s = new Scanner(System.in);
- boolean bigLetters=false;
- char[] letters = new char[10];
- System.out.println("put some char's");
- for (int i =0;i<letters.length;i++)
- {
- letters[i]=s.next().charAt(0);
- }
- for (int i = 0;i<letters.length;i+=1)
- {
- bigLetters=letters[i] >= 'A' && letters[i] <= 'Z';
- if (bigLetters){
- System.out.println("THE BIG LETTER IS:"+letters[i]);
- }
- }
- }
- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- TARGIL 3
- public class Main {
- public static void main(String[] args)
- {
- Scanner s= new Scanner(System.in);
- int[]arr=new int[10];
- System.out.println("enter ten num's");
- for (int i=0;i<arr.length;i++)
- {
- arr[i] = s.nextInt();
- }
- for (int i=0;i<arr.length;i++)
- if (arr[i] % 3 == 0) {
- System.out.println(arr[i]);
- }
- }
- }
- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- TARGIL 4
- public class Main {
- public static void main(String[] args)
- {
- Scanner s= new Scanner(System.in);
- int[]arr=new int[10];
- System.out.println("enter ten num's");
- for (int i=0;i<arr.length;i++)
- {
- arr[i] = s.nextInt();
- }
- for (int i=0;i<arr.length;i++)
- if (arr[i]%2 == 0) {
- arr[i]+=1;
- System.out.println(arr[i]);
- ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- TARGIL 5
- public class Main {
- public static void main(String[] args) {
- Scanner s = new Scanner(System.in);
- int[] arr = new int[10];
- System.out.println("enter ten num's");
- for (int i = 0; i < arr.length; i++) {
- arr[i] = s.nextInt();
- }
- for (int i = 0; i < arr.length; i++) {
- if (i % 2 == 0) {
- System.out.println(arr[i] + 1);
- }
- if (i!=0&&i% 3 == 0) {
- System.out.println(arr[i]-1);
- }
- }
- /////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
- TARGIL 6
- public class Main {
- public static void main(String[] args)
- {
- Scanner s = new Scanner(System.in);
- int counter=0;
- char[]letters=new char[10];
- char ch;
- System.out.println("put any char");
- ch=s.next().charAt(0);
- for (int i =0;i<10;i+=1)
- {
- System.out.println("enter some char's");
- letters[i] = s.next().charAt(0);
- }
- for (int i=0;i<10;i++)
- {
- if(letters[i]==ch)
- counter+=1;
- }
- System.out.println(" you put the:"+ch+" "+counter+" times");
- }
- }
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
- TARGIL 7
- public class Main
- {
- public static void main(String[] args) {
- Scanner s = new Scanner(System.in);
- int[][]arr=new int[5][5];
- System.out.println("enter few num's");
- for (int i=0;i<arr.length;i++)
- {
- arr[0][i]=s.nextInt();
- }
- System.out.println("enter few num's");
- for (int i=0;i<arr.length;i++)
- {
- arr[1][i]=s.nextInt();
- }
- for (int i=0;i<arr.length;i++)
- {
- if (arr[0][i]==arr[1][i])
- {
- System.out.println("you put the same num in the: "+i+ " cave");
- }
- }
- ///////////////////////////////////////////////////////////////////////////////////////////////////////////////
- TARGIL 8
- public class Main {
- public static void main(String[] args) {
- Scanner s = new Scanner(System.in);
- int[][][] arr = new int[5][5][5];
- System.out.println("put 10 num's");
- for (int i=0;i<arr.length;i+=1)
- {
- arr[0][i][i]=s.nextInt();
- }
- for (int i=0;i<arr.length;i+=1)
- {
- arr[1][i][i]=s.nextInt();
- }
- for (int i=0;i<5;i+=1)
- {
- arr[2][i][i]=arr[1][i][i]+arr[0][i][i];
- System.out.println(arr[2][i][i]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement