we have 100 questions and 60 students. write a java code that randomly selects 20 questions from 100 questions to 60 students.
1
Expert's answer
2012-12-11T08:34:21-0500
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++; & } } }
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
"assignmentexpert.com" is professional group of people in Math subjects! They did assignments in very high level of mathematical modelling in the best quality. Thanks a lot
Comments
Leave a comment