Search:

Type: Posts; User: Jad_Asmar

Search: Search took 0.15 seconds.

  1. Replies
    4
    Views
    1,878

    Counting duplicates in a Stack

    Hey guys , I am having a problem with my code , consider this problem:


    Write a method compressDuplicates that accepts a stack of integers as a parameter and that replaces each sequence of...
  2. Re: HashMap , trying to get the size of the value and NOT the keys.

    Thank you , thank you , thank you.
    You sir have made my day ! :D
  3. Re: HashMap , trying to get the size of the value and NOT the keys.

    The length of the keys in the picture that i attached is 6 , but the length or ( count ) of the values is 4 .
    If you use map.size(); a value of 6 will be returned .
    What can i code or what can i...
  4. Re: HashMap , trying to get the size of the value and NOT the keys.

    It is very simple , map.size() will give us the length of key from the HashMap , i just want the length of the values not the keys.

    Here i sketched this :2831
  5. Re: HashMap , trying to get the size of the value and NOT the keys.

    Thank you for your reply,
    What I meant is that in my assignment the first question asked is " what is the number of the tags of the novel ?" and by tags i mean " Location " or "Person"...
    The keys...
  6. Replies
    4
    Views
    976

    Re: How do I run the if statement?

    You are trying to compare a string with the compare method of two integers , if you had like:
    int A =1 ;
    int B=2;
    here you can use if(A==B)
    return true;
    However when...
  7. HashMap , trying to get the size of the value and NOT the keys.

    Hello guys , I am asked in my assignment to make a program that accepts a text file as an example a novel and i have to sort each word as a PERSON or ORGANIZATION or LOCATION or O as in Other ,...
  8. Replies
    11
    Views
    1,280

    Re: Problem with arrays2

    you just switch the "returns" anyhow here's the code :


    public class test2 {
    public static void main(String[] args) {
    double[] crazy = { 1.0, 2.0, 2.5 };...
  9. Replies
    11
    Views
    1,280

    Re: Problem with arrays2

    I get it , thank you guys for your help :)
  10. Replies
    11
    Views
    1,280

    Re: Problem with arrays2

    Ok i got it all right now but i do have another question , take a look :


    public class test2 {
    public static void main(String[] args) {
    double[] crazy = { 1.0, 2.0, 2.5 };...
  11. Replies
    11
    Views
    1,280

    Re: Problem with arrays2

    Thank you for your help guys but i'm sorry i still am a beginner to java can you explain more to me? And help me to solve my problem ? Thank you.
  12. Replies
    11
    Views
    1,280

    Problem with arrays2

    I am making a program that if the user enter a sequence of double in an array if it is sorted right the prog will return true if not it will return false .. what is wrong here ? always i get true.
    ...
  13. Replies
    3
    Views
    1,192

    Re: Searching for words in a file

    " one of the String class's "
    could you give me an example ? and are you sure it's the best way that is to divide the lines in lines ? Consider the file is too large isn't it wrong to consider...
  14. Replies
    3
    Views
    1,192

    Searching for words in a file

    Good morning , i am writing a program that will wait for the user to enter a molecule , lets say he enters " h20" the program will go to a file search for the word and puts the weight name .. into an...
  15. Replies
    2
    Views
    968

    Arrays , command line arguments

    Good evening everyone,
    i want to make a program that read a list of integers as an array then prints the reverse of it however these integers should be passed as command line arguments but my...
  16. Replies
    4
    Views
    972

    Re: Problem with arrays

    The problem is that i get no output , i know how to use arrays.ToString but the problem is i get no output.
  17. Replies
    4
    Views
    972

    Problem with arrays

    Good evening everyone , I am curently having problem since i want to make a basic program which basically reverse all the numbers of a certain array into the same array , by that i mean i want to...
  18. Replies
    6
    Views
    1,035

    Re: Why isn't this grade averaging working?

    It's because you are not saving the variables that the user is typing try as an example
    int input=console.nextInt;

    --- Update ---

    Oh sorry since the user will put many integer example :25 65...
  19. Replies
    5
    Views
    1,137

    Re: One fast question

    Yes i am aware of these facts that integer divided by an integer will result an integer but if a double divided by an integer will result a double , however i treid setting all of my int to double...
  20. Replies
    6
    Views
    1,241

    Re: Problem with arrays

    Thank you Christopher , but the thing is I would like to create an array but randomly and by that i mean it can be 4 arrays 5 or 6 up to 10 ; that's what i want .
    To make it clear my whole program...
  21. Replies
    5
    Views
    1,137

    Re: One fast question

    Yes I do like a longer answer , and sorry for posting my thread titled " Easy " will be making sure next time to write my title better.
  22. Replies
    5
    Views
    1,137

    One fast question

    Would you please tell me why my output is always 0.0 ? i want my program to print the sum of the values that are less than the average of all of the values generated .


    import java.util.*;
    ...
  23. Replies
    6
    Views
    1,241

    Re: Problem with arrays

    Oh god , what a foolish mistake , thank you !
  24. Replies
    6
    Views
    1,241

    Problem with arrays

    Good evening everyone ,
    I am writing this post to ask you guys if you can help me on this very basic program .
    I am still a student in programming and a beginner with arrays and i am asked to...
Results 1 to 24 of 24