Skip to main content
留学咨询

辅导案例-COMP 110

By May 15, 2020No Comments

Project 5 – Selection Sort COMP 110 Professor Haghoo 1 Summary of Project 5 • Implement object oriented version of Project 4. • Define a new class, FLSelctionSort, where F and L are your own initials. • See its UML (Unified Modeling Language) for this class. 2 Student Name – End of Project 3 UML Class Diagram Class Name FLSelectionSort Notes Data Fields final int MIN_SIZE = 12; final int MAX_SIZE = 20; final int MIN_DATA = 10; final int MAX_DATA = 99; private int [] samples = new int [MAX_SIZE]; private int sampleSize; Constants need not to be private. Because they cannot be modified. Construct ors FLSelectionSort(); • Get a random number of sample size similar to Project 4 • Populate the array by random numbers similar to Project 4 Methods int getArraySize() void printSamples () int samplesMin () int samplesMax () void selectionSort () int average () int median () getArraySize is a getter. Other me hods are functionally identical to those in Project 4 Main Method (Project 4 & Project 5) 3 Samples Methods (Project 4 & Project 5) 4 Output Samples 5 Project 5 – Last Slide COMP 110 6

admin

Author admin

More posts by admin