subject

Revise the meanmedian class so that the user can enter any number of values up to 20. if the list has an even number of values, the median is the numeric average of the values in the two middle positions. allow the user to enter to quit entering numbers. import java. util.*; class meanmedian2{public static void main(string[] args){// int[] nums; int num = 0; string entry; string list = "you entered: "; int a, b; int temp; double median; int total = 0; double mean = 0; final int quit = ; int size = 0; for(a = 0; num ! = quit & & a < nums. length; ++a){// your code here}system. out. println("size is " + a); if(num ! = quit)size = nums. length; elsesize = a - 1; system. out. println("size is " + size); system. out. println(list); int comparisonstomake = size - 1; for(a = 0; a < size - 1; ++a){for(b = 0; b < comparisonstomake; ++b){if(nums[b] > nums[b + 1]){temp = nums[b]; nums[b] = nums[b + 1]; nums[b + 1] = temp; }}--comparisonstomake; } // your code heresystem. out. println("the mean is " + mean +" and the median is " + median); }}

ansver
Answers: 2

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 19:30, andyromero
Once the data center routes to the destination server that hosts the website, what's the next step in the internet process? user’s browser renders html code from destination server into web page request goes through router/model and isp request routed to nameserver and datacenter
Answers: 2
image
Computers and Technology, 22.06.2019 21:30, Tcareyoliver
The salespeople at hyperactive media sales all use laptop computers so they can take data with them on the road. you are a salesperson for superduper lightspeed computers talking to hyperactive media sales about upgrading the laptops to windows 10. explain how network location awareness in windows 10 would make the laptops more secure.
Answers: 3
image
Computers and Technology, 23.06.2019 23:00, GreenHerbz206
Computer programming is one type of what career
Answers: 1
image
Computers and Technology, 24.06.2019 11:00, airbenderjermai
Need fast im timed in a paragraph of 125 words, explain at least three ways that engineers explore possible solutions in their projects.
Answers: 2
You know the right answer?
Revise the meanmedian class so that the user can enter any number of values up to 20. if the list ha...

Questions in other subjects:

Konu
Mathematics, 13.07.2021 19:50