Page 1 of 3 123 LastLast
Results 1 to 20 of 60
Like Tree1Likes

Thread: need program logic

  1. #1
    anonymouss is offline Member
    Join Date
    Apr 2013
    Posts
    26
    Rep Power
    0

    Default need program logic

    hi, i am java learner,so i need some programs anyone can able to post here or give some logics

  2. #2
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default Re: need program logic

    Plenty here: The Really Big Index
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  3. #3
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,432
    Blog Entries
    7
    Rep Power
    20

    Default Re: need program logic

    Here's another one (A and B are boolean expressions):

    !(A || B) == !A && !B

    and

    !(A && B) == !A || !B

    mostly done wrong in situations where you have your brain powered off ...

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  4. #4
    anonymouss is offline Member
    Join Date
    Apr 2013
    Posts
    26
    Rep Power
    0

    Default Re: need program logic

    hi to all, is it possible comparing two arrays and remove duplicates and written in a single array

  5. #5
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,432
    Blog Entries
    7
    Rep Power
    20

    Default Re: need program logic

    Are you ignoring previous replies by starting just another unrelated question in the same thread?

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  6. #6
    anonymouss is offline Member
    Join Date
    Apr 2013
    Posts
    26
    Rep Power
    0

    Default Re: need program logic

    Quote Originally Posted by JosAH View Post
    Here's another one (A and B are boolean expressions):

    !(A || B) == !A && !B

    and

    !(A && B) == !A || !B

    mostly done wrong in situations where you have your brain powered off ...

    kind regards,

    Jos
    what is this,iam not getting,and im not ignoring

  7. #7
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,432
    Blog Entries
    7
    Rep Power
    20

    Default Re: need program logic

    Quote Originally Posted by anonymouss View Post
    what is this,iam not getting,and im not ignoring
    Those are De Morgan's laws; they are very fundamental laws in Boolean logic and mostly misunderstood.

    kind regards,

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  8. #8
    anonymouss is offline Member
    Join Date
    Apr 2013
    Posts
    26
    Rep Power
    0

    Default Re: need program logic

    Quote Originally Posted by JosAH View Post
    Those are De Morgan's laws; they are very fundamental laws in Boolean logic and mostly misunderstood.

    kind regards,

    Jos
    ok but iam looking for this if we provide two arrays with duplicate values we have to remove duplicate and print the values as a single array

  9. #9
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,432
    Blog Entries
    7
    Rep Power
    20

    Default Re: need program logic

    Quote Originally Posted by anonymouss View Post
    ok but iam looking for this if we provide two arrays with duplicate values we have to remove duplicate and print the values as a single array
    No you were not; you were looking for (and I quote here):

    hi, i am java learner,so i need some programs anyone can able to post here or give some logics
    and you got two replies and you never gave an answer to them.

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  10. #10
    anonymouss is offline Member
    Join Date
    Apr 2013
    Posts
    26
    Rep Power
    0

    Default Re: need program logic

    Quote Originally Posted by PhHein View Post
    k thankx but iam not basic learner, i have some doubts which regarding to programs and expecting some program to implement with help of u

    Quote Originally Posted by JosAH View Post
    No you were not; you were looking for (and I quote here):
    why it is not possible ,for example i l say int a[]={5,4,2,1}; and int b[]={5,6,2,8};
    the output will be 5,4,6,2,8,1
    2)what about this 2,10,15,2 add the elements in command line argument and remove duplicates?
    Last edited by anonymouss; 04-26-2013 at 06:48 AM.

  11. #11
    SurfMan's Avatar
    SurfMan is offline Godlike
    Join Date
    Nov 2012
    Location
    The Netherlands
    Posts
    926
    Rep Power
    2

    Default Re: need program logic

    Quote Originally Posted by anonymouss View Post
    k thankx but iam not basic learner, i have some doubts which regarding to programs and expecting some program to implement with help of u
    why it is not possible ,for example i l say int a[]={5,4,2,1}; and int b[]={5,6,2,8};
    the output will be 5,4,6,2,8,1
    2)what about this 2,10,15,2 add the elements in command line argument and remove duplicates?
    What code have you got so far? You obviously understand that you came to java-forums.org, not rent-a-coder.com?

  12. #12
    anonymouss is offline Member
    Join Date
    Apr 2013
    Posts
    26
    Rep Power
    0

    Default Re: need program logic

    iam not asking to write the program or write the enter code, let me clear int a[]={2,10,15,2 ,8};i want to remove duplicates and writted output as 2,10,15,8,how to remove duplicates if anyone have idea or logic just tell me then i will implement

  13. #13
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,432
    Blog Entries
    7
    Rep Power
    20

    Default Re: need program logic

    Quote Originally Posted by anonymouss View Post
    iam not asking to write the program or write the enter code, let me clear int a[]={2,10,15,2 ,8};i want to remove duplicates and writted output as 2,10,15,8,how to remove duplicates if anyone have idea or logic just tell me then i will implement
    Put them in a Set<Integer> and create a new array from that set.

    kind regards,

    Jos
    PhHein likes this.
    cenosillicaphobia: the fear for an empty beer glass

  14. #14
    anonymouss is offline Member
    Join Date
    Apr 2013
    Posts
    26
    Rep Power
    0

    Default Re: need program logic

    yeah i know set does not allow duplicate elements,so i want to remove them without using collections

  15. #15
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,432
    Blog Entries
    7
    Rep Power
    20

    Default Re: need program logic

    Quote Originally Posted by anonymouss View Post
    yeah i know set does not allow duplicate elements,so i want to remove them without using collections
    Ah, you want a cripple 'beginners' solution with for- and while-loops, a few if-statements here and there and possibly a few funny flags instead? How strange ...

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  16. #16
    PhHein's Avatar
    PhHein is offline Senior Member
    Join Date
    Apr 2009
    Location
    Germany
    Posts
    1,430
    Rep Power
    7

    Default Re: need program logic

    Quote Originally Posted by anonymouss View Post
    yeah i know set does not allow duplicate elements,so i want to remove them without using collections
    Should be no problem for you:
    iam not basic learner
    Math problems? Call 1-800-[(10x)(13i)^2]-[sin(xy)/2.362x]
    The Ubiquitous Newbie Tips

  17. #17
    anonymouss is offline Member
    Join Date
    Apr 2013
    Posts
    26
    Rep Power
    0

    Default Re: need program logic

    Quote Originally Posted by PhHein View Post
    Should be no problem for you:
    ha,but struck up with logic

  18. #18
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,432
    Blog Entries
    7
    Rep Power
    20

    Default Re: need program logic

    Quote Originally Posted by anonymouss View Post
    ha,but struck up with logic
    There is (almost) no logic at the application level in the suggestion in reply #13.

    Jos
    cenosillicaphobia: the fear for an empty beer glass

  19. #19
    anonymouss is offline Member
    Join Date
    Apr 2013
    Posts
    26
    Rep Power
    0

    Default Re: need program logic

    Quote Originally Posted by JosAH View Post
    There is (almost) no logic at the application level in the suggestion in reply #13.

    Jos
    k thanks i ll try myself, k let me tell java doesnot execute line by line then how to understand program when we are looking at ,i want to know exceution process for below program
    Java Code:
     public class Bubblesort
    {
    	public static void main(String arsg[])
    	{
      		int i;
      		int array[] = {12,5,4,85,18,1,3,10};
      		System.out.println("Values Before the sort:\n");
      		for(i = 0; i < array.length; i++)
    		
      		System.out.print( array[i]+"  ");
    		System.out.println();
    		
      		int n=array.length;
      		bubble_srt(array, array.length);
    		
      		System.out.print("Values after the sort:\n");
      		for(i = 0; i <array.length; i++)
      		System.out.print(array[i]+"  ");
      		System.out.println();
      		System.out.println("PAUSE");
      	}
    
      	public static void bubble_srt( int a[], int n )
    	
    	{
      		int i, j,t=0;
      		for(i = 0; i < a.length; i++)
    		{
      			for(j = 1; j < (a.length-i); j++)
    			{
      				if(a[j-1] > a[j])
    				{
      					t = a[j-1];
      					a[j-1]=a[j];
      					a[j]=t;
      				}
      			}
      		}
     	 }
    }

  20. #20
    JosAH's Avatar
    JosAH is online now Moderator
    Join Date
    Sep 2008
    Location
    Voorschoten, the Netherlands
    Posts
    13,432
    Blog Entries
    7
    Rep Power
    20

    Default Re: need program logic

    Quote Originally Posted by anonymouss View Post
    k thanks i ll try myself, k let me tell java doesnot execute line by line then how to understand program when we are looking at ,i want to know exceution process for below program
    You haven't written this code yourself, have you? Otherwise you wouldn't have asked this. And please stop asking different questions all the time without properly discussing the replies to your previous questions.

    Jos
    cenosillicaphobia: the fear for an empty beer glass

Page 1 of 3 123 LastLast

Similar Threads

  1. Replies: 11
    Last Post: 02-01-2013, 11:47 PM
  2. how is the logic this program???
    By riris in forum New To Java
    Replies: 4
    Last Post: 03-16-2012, 05:38 PM
  3. Need help on this program logic
    By cotemaria in forum New To Java
    Replies: 1
    Last Post: 11-12-2011, 09:14 PM
  4. need help in merging GUI and logic main program
    By lavender88 in forum NetBeans
    Replies: 2
    Last Post: 04-02-2011, 01:28 PM
  5. Separating program logic and GUI
    By loopingman in forum AWT / Swing
    Replies: 0
    Last Post: 12-08-2008, 02:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •