how to generate random questions

how to generate random questions

View Answers

April 2, 2009 at 4:06 PM

Hi friend,

Plz specify the technology with full details like Java,JSP,Servlet,ASP and .net etc...

See the below code in Java to help in solving the problem :

import java.util.*;
class RandomQuestion
{
public static void main(String[] args)
{
String[] questionAr=new String[5];
questionAr[0]="Question No 1";
questionAr[1]="Question No 2";
questionAr[2]="Question No 3";
questionAr[3]="Question No 4";
questionAr[4]="Question No 5";
Random generator = new Random();
int r = generator.nextInt(questionAr.length);
System.out.println(questionAr[r]);
}
}


Thanks









Related Tutorials/Questions & Answers:
how to generate random questions - Java Beginners
how to generate random questions  i am designing a test engine, i want my questions to be generated randomly. how can i do this?   Hi..."; Random generator = new Random(); int r = generator.nextInt(questionAr.length
How to generate a list of random numbers?
How to generate a list of random numbers?  Hi, How to generate a list of random numbers? I want code in scala programming language. Thanks  ... of Scala programming and it generates random integer. Following program
Advertisements
How to generate a list of random numbers?
How to generate a list of random numbers?  Hi, How to generate a list of random numbers? I want code in scala programming language. Thanks  ... of Scala programming and it generates random integer. Following program
How to generate a list of random numbers?
How to generate a list of random numbers?  Hi, How to generate a list of random numbers? I want code in scala programming language. Thanks  ... of Scala programming and it generates random integer. Following program
How do I generate random number?
How do I generate random number?  In my Java program there is a requirement of generating random numbers between two given numbers. How do I write..., The java.util.Random class can be used to generate the random numbers. Check the tutorial
How to generate random number in java
How to generate random number in java In this section you will learn how to generate random number in java. Java API  provide a random class in java.util.Random package which generate random number within a range. The random
Generate Random Numbers
Generate Random Numbers  hi,,, Please give me answer with example How do you generate random numbers within a given limit with actionscript... This function generate random numbers with in given limit
ModuleNotFoundError: No module named 'random_string_generate'
: No module named 'random_string_generate' How to remove the ModuleNotFoundError: No module named 'random_string_generate' error? Thanks   Hi...ModuleNotFoundError: No module named 'random_string_generate'  Hi
ModuleNotFoundError: No module named 'random_string_generate'
: No module named 'random_string_generate' How to remove the ModuleNotFoundError: No module named 'random_string_generate' error? Thanks   Hi...ModuleNotFoundError: No module named 'random_string_generate'  Hi
Generate random numbers in Java
Generate random numbers in Java - How to use the java.util.Random class to generate desired random number in Java program? In this tutorial I will teach you... these related tutorials. How to generate random number in Java
Generate array of random numbers without repetition
Generate array of random numbers without repetition In the previous section, you have learnt how to generate an array of random numbers from the given array... created an application that will generate the array of random numbers without
generate random numbers and display the largest
generate random numbers and display the largest  Hi, I am using... creates an array and fills it with random ints, prints the contents... ArrayRandom{ public static void main(String args[]){ Random r = new Random
Generate Random Integer Between Two Values in Scala
Generate Random Integer Between Two Values in Scala  Hi, I am working on the SCALA project and want to generate random integer between two numbers. How to Generate Random Integer Between Two Values in Scala? Thanks   
Generate Random Integer Between Two Values in Scala
Generate Random Integer Between Two Values in Scala  Hi, I am working on the SCALA project and want to generate random integer between two numbers. How to Generate Random Integer Between Two Values in Scala? Thanks   
generate random integer matrix in r
generate random integer matrix in r  Hi, I want to generate random integer matrix in r. What is easy code to generate random integer matrix in r? Thanks   Hi, Following is the code for generating random integer
Generate random numbers from 1 to 100
Generate random numbers from 1 to 100  1)A class Called: RandomNumberGenerator that generate random numbers from 1 to 100 2)A class Test that tests... an object from the Random NumberGenerator class to generate your input test data
Generate random number between two numbers in Scala
Generate random number between two numbers in Scala  Hi, How to Generate random number between two numbers in Scala? Thanks   Hi, Following code can be used for generating random number in scala: val rand = new
Generate random number between two numbers in Scala
Generate random number between two numbers in Scala  Hi, How to Generate random number between two numbers in Scala? Thanks   Hi, Following code can be used for generating random number in scala: val rand = new
Default constructor generate two random equations
Default constructor generate two random equations  Need to create a default constructor in a programmer defined class that generates a random question, addition or subtraction. And when adding the numbers must be random from 0-12
generate graf report.. - JSP-Interview Questions
generate graf report..  How to generate report(graf) using jsp code
Generating Random Number
for your application. Random Number is the frequently used to generate numbers... how to create a random number and example provided here will help you easily understand and use the code to generate random numbers in your java
Generate array of random numbers
Generate array of random numbers You can generate a random number either by using the Random class or by using the static method Math.random() but it is better to use Random class. If you want to generate a series of random numbers
how to generate auto code ?
how to generate auto code ?  i wanna genrate auto code for id in core java. pls tell me code of auto genrate
Generate shuffling in the specified list
list1 = Arrays.asList(employee); // create object of Random class to generate number randomly. Random num = new Random(); // shuffle and print the list according to the generated random number
how to generate bank account number?
how to generate bank account number?  how to generate account number?or format or rules for bank account number
J2ME Random Number
J2ME Random Number       In this application we are going to generate the random number using Random class. The Random class within the java.util package and we can use
how to show random image in ASP.net?
how to show random image in ASP.net?  hello bros i saw in many websites..there is a programming of random image changing.... i want to use this in my ASP.NET websites, can any one suggest me code or any kind of help..so that i
how to generate udp packets in linux
how to generate udp packets in linux  Hi, For testing one of my application I want to send udp data. how to generate udp packets in linux? Thanks...;Hi, Thanks it works. I was searching for "how to generate udp packets in linux
how to generate udp packets in linux
how to generate udp packets in linux  Hi, For testing one of my application I want to send udp data. how to generate udp packets in linux? Thanks...;Hi, Thanks it works. I was searching for "how to generate udp packets in linux
How to generate XML from XSD?
How to generate XML from XSD?  Hi Experts, I have a xsd with me. I want to generate XML files based on the XSD with fields filled out from the database tables. Please Help me out
Generate area for map from backing bean - Java Server Faces Questions
Generate area for map from backing bean  I need to populate the map in my page, and the coordinates should come from the backing bean.. How could I do
How to create a random matrix in r?
How to create a random matrix in r?  Hi, I want to create random matrix in R programming language. How to create a random matrix in r? Explain me... random numbers can be generated with the help of function rnorm(n, mean = , sd
how to generate code - Java Beginners
how to generate code   hi friends, this is poornima i want to generate code about online shopping by using servlets,jsp,html,jdbc and eclipse (IDE) could you please tell me about what are steps included. Thanks in advance
how to generate timetable - JSP-Servlet
how to generate timetable  can i have a jsp/servlet code for generating timetable for examinations for university like courses btech,cse ece etc... By giving starting date and ending date it will automatically generate
how to generate pdf file in struts
how to generate pdf file in struts  I am developing a struts application.I am having one registration form when i am submitting the form the values are stored in database,the database name is registration. In another form i am
how to generate pdf file in struts
how to generate pdf file in struts  I am developing a struts application.I am having one registration form when i am submitting the form the values are stored in database,the database name is registration. In another form i am
How to generate build.xml file
How to generate build.xml file       This example shows how to generate the build.xml file. You may say that build.xml file is the backbone of ANT (Another Neat Tool
random number
random number   Please How do I generate a program that gives me random integer from 115 to 250? Using java.util.random. Thank you very much!  ... main(String[] args){ int min = 115; int max = 250; Random random
How to Generate Reports in Java - Java Beginners
How to Generate Reports in Java  How to Display and Generate Reports in Java? Give Me Full Sample Code  Hi Friend, What do you want to display on reports.Please elaborate it. Thanks
how to generate the pdf report from jsp
how to generate the pdf report from jsp  <%@page import="com.itextpdf.text.,com.itextpdf.text.pdf.,java.io.*;"%> </head> <... want to generate the pdf file from jsp page.I add the itext.jar to the libraries
using random number
using random number  generate a 10 digit number using random number and display the length of longest increasing series
how to select random rows from database through servlet
how to select random rows from database through servlet  hello i want to know, how to select random rows from database through servlet
How to generate xml file using xpath
How to generate xml file using xpath  Hi, I have a requirement in whixh I have x path of all the nodes with its corresponding values and I need to make a xml using that,. It would be great is you can help me out with how
how to generate captcha in jsp page ? - JSP-Servlet
how to generate captcha in jsp page ?  hi friends, i would like to implement Captcha in login screen. i'm unsing struts. could you please give some sample codes to implement this. Thank you Ganesh  Hi, This link
How to generate the pdf file using jsp - JSP-Servlet
How to generate the pdf file using jsp  Hi how to generate the pdf file in jsp  Hi Friend, Try the following code: Thanks
random numbers
random numbers  hi.. i am creating a website and on feedback form to authenticate user i want to generate a random number on label.if user types that number correctly in textbox then he is allowed to submit feedback otherwise
how to generate automatic bill based on selected values using jsp/javascript?
how to generate automatic bill based on selected values using jsp/javascript?  how to generate automatic bill based on selected values using jsp/javascript
how to make multiple choice questions
how to make multiple choice questions  I have to make a multiple choice choice using JSP/Servlets. I created a a session bean for the questions and answers. how to associate group of questions to a user? so each user will have
using random number
using random number  generate 10 number and display the length of longest incresing series
using random number
using random number  generate 10 digit number and display the length of longest incresing swries

Ads