PLEASE EXPLAIN IN DETAIL HOW THIS CODE WORKS
package selectionsortexample;
public class SelectionSortExample {
public static void selectionSort(int[] arr){
for (int i = 0; i < arr.length - 1; i++)
{
int index = i;
for (int j = i + 1; j < arr.length; j++){
if (arr[j] < arr[index]){
index = j;//searching for lowest index
}
}
int smallerNumber = arr[index];
arr[index] = arr[i];
arr[i] = smallerNumber;
}
}
Write a program in java to store marks of 10 students out of 100 in a single dimension array then it was decided to give 5 marks grace to each student with a condition that maximum mark cannot exceed 100. Then display the new marks from the array in one line.
write a java programme to display the rectangular .
hits:use for loop
and dispalay the following information and Calaterlate it
+--------------------------------------------------------+
| |
|Module Code Attendance Exam Mark Grade |
| CS402 100% 86 HD |
| CS406 95% 74 D |
| CS407 67% 34 F |
| |
|Average Mark: 64.67 |
|Average attendance: 87.33% |
|Final Grage: C |
|Remark: You need to retake some modules. |
+--------------------------------------------------------+
Write a program that accepts 10 integer inputs from a user and store them in an array. The program must again ask the user to give another number and tell the user whether that number is present or not in the array. If the number is present, the program must identify its array location otherwise it should display a message “Number not Found!”.
Write a program that allows the user to enter the last names of five candidates in a local election and the votes received by each candidate. The program should then output each candidate’s name, the votes received by that candidate, and the percentage of the total votes received by the candidate. Your program should also output the winner of the election. A sample output is:
Candidate Votes Received % of Total Votes
Johnson 5000 25.91
Miller 4000 20.72
Duffy 6000 31.09
Robinson 2500 12.95
Ashtony 1800 9.33
Total 19300
The Winner of the Election is Duffy.
write a java program (use if else).......display those information...
Testing: Please create testing report by including the output summary of the 4 students. Among the 4 students, there should be 1 student who passes all modules exam and attendance (Remark: Congratulation! You pass the module!), 1 student who passes all modules exam but fails some attendance (Remark: You fail the module due to low attendance. Please attend the make up classes.), 1 student who fails some module exam but pass all modules attendance (Remark: You fail the module. Please take the re-exam.), 1 student who fails some modules in both exam and attendance (Remark: You fail the module. Please retake the module.)
by CodeChum Admin
Did you know that you can also reverse lists and group them according to your liking with proper code? Let's try it to believe it.
Instructions:
Input
The first line contains an odd positive integer.
The next lines contains an integer.
5
1
3
4
5
2Output
A line containing a list.
[2,5]-[4]-[3,1]Consider the following definitions:
void a (Object o, long x, long y) // defn 1
void a (String s, int x, long y) // defn 2
void m (Object o, int x, long y) // defn 3
void a (String s, long I, int y) / defn 4
and suppose you have the following variable declarations:
Object u;
int a;
long b;
For each of the following calls, determine which definitions would match a particular call; also decide whether the call is legal, and if so, which of the preceding definitions is selected:
m (v ,a ,b);
m (v, a, a);
m (v, b, a);
m (v ,b ,b);
m (o, b, b);
m (0, a, a);
Write a program in java to store A to Z alphabets in a single dimension array then display the letters in one column and their UNICODE in another column with appropriate heading as follows:
Index No. Letters UNICODE
0 A 65
1 B 66
Write a program in java to take 20 numbers as input and store in a Single dimensional array then check and display only positive even numbers and also display how many such numbers found.