Find Us On: Facebook Twitter Rss Feed Blog
Need To Register? Sign Up Login

HouseholdSize.java or Using a Bubble Sort

Krukov101
Krukov101 


Remember this needs to be very basic java. This is Introductory class work. 1. Open the source code file named household size.java using Notepad or the text editor of your choice 2. write the bubble sort 3. Output the mean and median household size in Marengo 4. Save this source code file in a directory of your choice an then make that directory your working directory 5. Compile the file Remember this needs to be very basic java. This is Introductory class work. Attachments Tags Clarifications

Answers

bubblesort

haskellGeek
haskellGeek 



this uses your original code and does the bubble sort Attachments
HouseholdSize.java (2 K) Download Preview
Output: Mean and median household size. import javax.swing.*; public class HouseholdSize{ // Declare variables. final static int SIZE = 300; // Maximum number of household sizes. static int householdSizes[] = new int[SIZE]; // Array used to store up to 300 household sizes. static int

456788443--2.JPG (35 K) Download Preview

Screenshots
Screenshot
Purchase Answer

HouseholdSize.java or Using a Bubble Sort - Solution

mariobeka
mariobeka 



Implemented code as per specification. As most of the code was already
given, thus the price is lower.
Attachments
HouseHoldSize.java (3 K) Download Preview
x; pairsToCompare++ ) { if ( householdSizes[ pairsToCompare ] < householdSizes[pairsToCompare+1] ) // change to > for ascending sort { temp = householdSizes[ pairsToCompare ]; //swap elements householdSizes[ pairsToCompare ] = householdSizes[ pairsToCompare+1 ]; householdSizes[ pairsToCompare+1 ] = temp; switchOccurred = true; //shows a swap occurred } } } //

Screen Shot 2015-04-21 at 2.35.55 AM.png (18 K) Download Preview

Screenshots
Screenshot
Purchase Answer