PL Labexer4 Sacasas Elizalde
PL Labexer4 Sacasas Elizalde
PL Labexer4 Sacasas Elizalde
PROBLEM #: 1
Write a JAVA program that will input 10 scores and output the Highest and Lowest score.
REQUIREMENTS:
Input/s: 10 scores (e.g. 33, 38, 50, 42, 45, 23, 18, 39, 21, 43)
Output/s: Only the highest and lowest score (e.g. H = 50, L = 18)
SOURCE CODE:
import java.util.Arrays;
import java.util.Scanner;
int stud1, stud2, stud3, stud4, stud5, stud6, stud7, stud8, stud9, stud10;
int max = 0;
int count = 0;
int[] userInput = new int[10];
keyboard.close();
Arrays.sort(userInput);
max = userInput[userInput.length - 1];
System.out.println("LOWEST SCORE: " + userInput[0]);
SCREENSHOTS:
PROBLEM #: 2
Input/s:
Output/s: E.G.
0 10 **********
1 3 ***
2 6 ******
3 18 ******************
4 11 ***********
5 1 *
SOURCE CODE:
SCREENSHOTS:
PROBLEM #: 3
Input 5 integer values for arrayOne and 5 integer values for arrayTwo. Write a JAVA program that would
merges two ordered list of integers into a single ordered list object of integers. Merge the two arrays and
sort.
REQUIREMENTS:
Step 5: Output array one, array two, merged array and sorted array
Step 6: End
SOURCE CODE:
import java.util.Arrays;
Arrays.sort(arr3);
System.out.println("Sorted Array: " +Arrays.toString(arr3));
}
}
SCREENSHOTS: