63 057
Assignments Done
99,1%
Successfully Done
In July 2018

Answer to Question #20144 in Java | JSP | JSF for semere meshesha

Question #20144
we have 100 questions and 60 students. write a java code that randomly selects 20 questions from 100 questions to 60 students.
Expert's answer

import java.util.Random;


public class RandomQuestions {

public static void main(String args[]) {
& int n=1;
& Random r = new Random();
& while (n<61) {
System.out.print("Number of questions " + n + " is: ");
for (int i = 0; i < 20; i++) {
System.out.print((r.nextInt(100)+1)+" ");
}
System.out.println("");
n++;
& }
}
}

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be first!

Leave a comment

Ask Your question

Submit
Privacy policy Terms and Conditions