Search:

Type: Posts; User: eyalfish

Page 1 of 2 1 2

Search: Search took 0.41 seconds.

  1. Replies
    2
    Views
    123

    I cannot find my problem

    Hi everyone,

    File ff=new File("Questions.txt");
    Scanner f=new Scanner(ff);
    PrintWriter pq=new PrintWriter(ff);

    while(f.hasNext()){
    f.nextLine();
    }
  2. Replies
    0
    Views
    23

    whats wrong with this code please?

    String hex="7D";
    System.out.println(hexToDecimal(hex));
    }
    public static int hexToDecimal(String hex){
    int sum=0;int k=0;
    for(int i=hex.length()-1;i>=0;i--,k++){
    char...
  3. Replies
    3
    Views
    39

    Re: any idea?StringBuilder

    great i understoond and it works well via for loops.
    what isnt it working with my recursion:

    public static void switchLetters(StringBuilder str,int indexBegin,int indexEnd){
    StringBuilder...
  4. Replies
    3
    Views
    39

    any idea?StringBuilder

    Hello everyone,
    how can i replace each letter for example "abcde" to "edcba" with StringBuilder only and without the reverse tool:)
    this is what i tried:

    StringBuilder str=new...
  5. my first recursion ,what did i do wrong?

    public static boolean q8(int n){
    boolean check=true;

    if((n/10)<0){
    return check;
    }
    int f=n%10;
    int r=(n/10)%10;
    if((f%2==0)&&(r%2==0)){
    return check=false;
  6. Re: problem with understanding this recursion

    Thanks! Btw i didnt write the code i ordered to analayzed it.the value is indeed 952
  7. problem with understanding this recursion

    public static boolean goo(int n){
    If(n<10){
    Return n;
    }
    Int k=goo((n/100)*10+(n%10));
    Return (k*10 +(n%100)/10);

    }

    I am still a beginner to rec concept.
  8. Replies
    5
    Views
    83

    Re: How to create a text file?

    sorry i didnt find anything to make this text come to specific directory
  9. Replies
    5
    Views
    83

    How to create a text file?

    Hi everyone,
    this is what i tried(i tried a few things hope you would understand):

    File f=new File("c:/FilePractice/text.txt");
    f.mkdirs();

    and it creates only the folder text.txt.
    i am...
  10. Replies
    2
    Views
    44

    [SOLVED] Re: I need an advice

    Thanks Norm i just mistaken by the value .didnt see it
    This tread can be close thank you very much:)
  11. Replies
    2
    Views
    44

    [SOLVED] I need an advice

    Hi everybody ,
    can you guide me please what am i missing?
    so i create a class called Lecturer ,this is part of the code(of the class)

    private String name;
    private int numOfTimesPenFalls;...
  12. Replies
    0
    Views
    33

    [SOLVED] Need a little help,easy task

    nvm i understood:]
  13. Replies
    3
    Views
    165

    Re: Hi everyone i need some advice

    For(int i=0,j=1;i<=4;i+=2,j+=2){
    for(int k=i;k<=i;k++)
    Syso..print("*");
    For(int k=j;k<=j;k++)
    Syso..print(" ");
    }

    this is what i got the first line:
    *blank*blank*
  14. Replies
    3
    Views
    165

    Hi everyone i need some advice

    Hi,
    i need to create this shape:
    *" "*" "*
    " "*" "*" "
    " "" "*" "" "

    using loops.can you guide me on how to deal with the blank and asterisks?
    its just dont work correctly for me

    thanks...
  15. Replies
    9
    Views
    192

    Re: Again i need some advice please

    yes for array of example like i show{1 1 1 2 2}

    to matrix like that: 1 1 1
    2 2


    i count the number of different number=2.that's the row number.
    but how...
  16. Replies
    9
    Views
    192

    Re: Again i need some advice please

    yes it is sorted.
    i need to make a matrix from this array -each row different number and the times the number occuered
    1.i need to check how many numbers are different to determine how many rows i...
  17. Replies
    9
    Views
    192

    Re: Again i need some advice please

    int arr[]=new int[]{1,1,1,2,2};


    int row=2; //two different number=two rows
    int[][]matrix=new int[row][];
    for (int i=0;i<matrix.length;i++){
    for(int...
  18. Replies
    9
    Views
    192

    Re: Again i need some advice please

    You know what lets say i have an array of strings{"james","john","james","john","james"}

    I need to initialize a matrix that each row contain a different name.

    --- Update ---

    The output will...
  19. Replies
    9
    Views
    192

    Again i need some advice please

    Sorry to bother you that much.
    I have a project that contain an array of people(each index contain name,salary and id number).
    i need to make a matrix that each name will be in a new row.
    so i did...
  20. Re: Hi everyone i stuck at something and i need a little help please

    You are a king!!!!!!!!!!!!!!!
    thank you thank you:]
  21. Re: Hi everyone i stuck at something and i need a little help please

    This my code:

    Scanner s=new Scanner(System.in);
    int Id=0;String Name="";int Salary=0;


    for (int i=0;i<arr.length;i++){

    Employee temp=new Employee(Id,Name,Salary);...
  22. Re: Hi everyone i stuck at something and i need a little help please

    I need to create array and input value in this order:int id(integer),String name(must be nextline),int salary(integer).
    i fount that if i do s.nextline after the name=s.nextline it fix this....
  23. Re: Hi everyone i stuck at something and i need a little help please

    Thanks but it still gives me trouble.i need to create an array that contains String(needed nextline) and integers.
    but the momonet i want to print my array the data conataine string is empty!...
  24. Hi everyone i stuck at something and i need a little help please

    We started to learn classes and i created this method :

    public static Student[] getStudentArray(Student[] arr){
    Scanner s=new Scanner(System.in);
    String Name;float Avg;

    for (int...
  25. Replies
    3
    Views
    186

    Re: Hi everyone i need some help

    Great thank you guys ,thanks you;]
Results 1 to 25 of 33
Page 1 of 2 1 2