Professional Documents
Culture Documents
Array Sort (Ascending Order) Practical Test: Prepared By: Mr. Argel Pascua
Array Sort (Ascending Order) Practical Test: Prepared By: Mr. Argel Pascua
Array Sort (Ascending Order) Practical Test: Prepared By: Mr. Argel Pascua
(Ascending Order)
Practical Test
Prepared by:
Mr. Argel Pascua
int number [ ];
number=new int [max]
num.length
import java.util.Arrays;
import java.util.*;
Create a program that will input
the maximum number or index
of array, and value of an array
element that will be based on
the maximum value and print
numbers in ascending order.
STEPS IN MAKING
AN ARRAY
import java.util.*;
STEPS IN MAKING
AN ARRAY
num=new int[max];
STEPS IN MAKING
AN ARRAY
for(i=0;i<num.length;i++)
{
System.out.println("Enter Numbers to Sort: ");
num[i]=scan.nextInt();
}
STEPS IN MAKING
AN ARRAY
Arrays.sort(num);
STEPS IN MAKING
AN ARRAY
System.out.println("Sorted Value");
for(y=0;y<=max;y++)
{
System.out.println(num[y]);
}
}catch(Exception e){}
What appropriate looping
Problem Set:
Runs smoothly and without Runs but with some glitches Still contain error or
5. Run without glitches warning.
error
Guide Questions: