create account

Java Application | Calculates the median value by ryal

View this thread on: hive.blogpeakd.comecency.com
· @ryal ·
$0.46
Java Application | Calculates the median value
<h3> Source Code</h3>
>import java.util.*;
public class MinMaxDAC {
    public static void main(String args[])
	{
		Scanner sc=new Scanner(System.in);
		System.out.println("Enter number of elements");
		int n=sc.nextInt();
		int a[]=new int[n];
		System.out.println("Enter elements");
		for(int i=0;i < n;i++)
		a[i]=sc.nextInt();		
		int c=0,part=0, d, s;
		while(part < n)
		{
			part=part+3;
			c++;
		}
		part=0;
		int l=0,h=2;
		while(part < c)
		{
			System.out.println("The part of array is");
			for(int i= l; i <= h; i++)
				System.out.println(a[i] + "  ");
			System.out.println();
		System.out.println("Maximum of this part of array is");
			int v=a[l];
			for(int i=l;i <= h;i++)
				if(a[i] > v)
					v=a[i];
			System.out.println(v);
			System.out.println();
		System.out.println("Minimum of this part of array is");
			int v1=a[l];
			for(int i=l;i <= h;i++)
				if(a[i] < v1)
					v1=a[i];
			System.out.println(v1);
			System.out.println();
			part++;
			l=l+3;
			if((h+3) < n)
				h=h+3;
			else
				h=n-1;
		}
		d=s=a[0];
		for(int i=0;i < n;i++)
		{
			if(a[i] > d)
			d=a[i];
			if(a[i] < s)
			s=a[i];
		}
		System.out.println("Maximum element is:"+d);
		System.out.println();
		System.out.println("Minimum element is:"+s);
	}
}

<center><h3>Output Aplication</h3>
<center>https://steemitimages.com/DQmaZNpfRbkanc9Z9ww6huLX5wpWVn85HisaPLGmZXyQQ9h/Median%20Aplication.png</center>
***
<center><h3>FOLLOW ME: @ryal</h3></center>
***
👍  , , , , , , , , , , , , , , , , , , ,
properties (23)
authorryal
permlinkjava-application-or-calculates-the-median-value-20171210t224529627z
categoryeducation
json_metadata{"links":[],"image":["https://steemitimages.com/DQmaZNpfRbkanc9Z9ww6huLX5wpWVn85HisaPLGmZXyQQ9h/Median%20Aplication.png"],"users":["ryal"],"tags":["education","science","programming","java","aplication"],"app":"esteem/1.4.6","format":"markdown+html","community":"esteem"}
created2017-12-10 15:45:36
last_update2017-12-10 15:45:36
depth0
children8
last_payout2017-12-17 15:45:36
cashout_time1969-12-31 23:59:59
total_payout_value0.450 HBD
curator_payout_value0.012 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length1,454
author_reputation138,533,904,283
root_title"Java Application | Calculates the median value"
beneficiaries
0.
accountesteemapp
weight500
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id23,008,520
net_rshares116,719,759,354
author_curate_reward""
vote details (20)
@sajda ·
tomorrow is my java book exmaz
👍  
properties (23)
authorsajda
permlinkre-ryal-java-application-or-calculates-the-median-value-20171210t154718160z
categoryeducation
json_metadata{"tags":["education"],"app":"steemit/0.1"}
created2017-12-10 15:46:54
last_update2017-12-10 15:46:54
depth1
children6
last_payout2017-12-17 15:46:54
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length30
author_reputation-287,824,802,148
root_title"Java Application | Calculates the median value"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id23,008,645
net_rshares0
author_curate_reward""
vote details (1)
@ryal ·
Ok, I will wait @sajda
properties (22)
authorryal
permlinkre-sajda-re-ryal-java-application-or-calculates-the-median-value-20171210t154842279z
categoryeducation
json_metadata{"tags":["education"],"users":["sajda"],"app":"steemit/0.1"}
created2017-12-10 15:48:48
last_update2017-12-10 15:48:48
depth2
children5
last_payout2017-12-17 15:48:48
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length22
author_reputation138,533,904,283
root_title"Java Application | Calculates the median value"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id23,008,867
net_rshares0
@sajda ·
wait for what?
properties (22)
authorsajda
permlinkre-ryal-re-sajda-re-ryal-java-application-or-calculates-the-median-value-20171210t154954030z
categoryeducation
json_metadata{"tags":["education"],"app":"steemit/0.1"}
created2017-12-10 15:49:30
last_update2017-12-10 15:49:30
depth3
children0
last_payout2017-12-17 15:49:30
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length14
author_reputation-287,824,802,148
root_title"Java Application | Calculates the median value"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id23,008,963
net_rshares0
@sajda ·
are u a programmer ?
properties (22)
authorsajda
permlinkre-ryal-re-sajda-re-ryal-java-application-or-calculates-the-median-value-20171210t155232513z
categoryeducation
json_metadata{"tags":["education"],"app":"steemit/0.1"}
created2017-12-10 15:52:09
last_update2017-12-10 15:52:09
depth3
children2
last_payout2017-12-17 15:52:09
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length20
author_reputation-287,824,802,148
root_title"Java Application | Calculates the median value"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id23,009,277
net_rshares0
@sajda ·
i made a website in c#
properties (22)
authorsajda
permlinkre-ryal-re-sajda-re-ryal-java-application-or-calculates-the-median-value-20171210t155256463z
categoryeducation
json_metadata{"tags":["education"],"app":"steemit/0.1"}
created2017-12-10 15:52:33
last_update2017-12-10 15:52:33
depth3
children0
last_payout2017-12-17 15:52:33
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length22
author_reputation-287,824,802,148
root_title"Java Application | Calculates the median value"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id23,009,327
net_rshares0
@steemitboard ·
Congratulations @ryal! You have completed some achievement on Steemit and have been rewarded with new badge(s) :

[![](https://steemitimages.com/70x80/http://steemitboard.com/notifications/firstcommented.png)](http://steemitboard.com/@ryal) You got a First Reply
[![](https://steemitimages.com/70x80/http://steemitboard.com/notifications/posts.png)](http://steemitboard.com/@ryal) Award for the number of posts published

Click on any badge to view your own Board of Honor on SteemitBoard.
For more information about SteemitBoard, click [here](https://steemit.com/@steemitboard)

If you no longer want to receive notifications, reply to this comment with the word `STOP`

> By upvoting this notification, you can help all Steemit users. Learn how [here](https://steemit.com/steemitboard/@steemitboard/http-i-cubeupload-com-7ciqeo-png)!
properties (22)
authorsteemitboard
permlinksteemitboard-notify-ryal-20171210t192302000z
categoryeducation
json_metadata{"image":["https://steemitboard.com/img/notifications.png"]}
created2017-12-10 19:22:42
last_update2017-12-10 19:22:42
depth1
children0
last_payout2017-12-17 19:22:42
cashout_time1969-12-31 23:59:59
total_payout_value0.000 HBD
curator_payout_value0.000 HBD
pending_payout_value0.000 HBD
promoted0.000 HBD
body_length835
author_reputation38,975,615,169,260
root_title"Java Application | Calculates the median value"
beneficiaries[]
max_accepted_payout1,000,000.000 HBD
percent_hbd10,000
post_id23,029,774
net_rshares0