/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gess3;
/**
*
* @author I B M
*/
import java.lang.Math;
import java.util.Scanner;
public class Gess3 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
final int Questions=5;
int cureectanswer=0;
int count=0;
long starttime=System. currentTimeMillis();
String output="";
Scanner input=new Scanner(System.in);
System.out.println("enter student name");
String b=input.nextLine();
System.out.println("enter program");
String d=input.nextLine();
System.out.println("enter student roll");
int c=input.nextInt();
System.out.println("total marks= 10");
while(count<Questions)
{
int number1=(int)(Math.random()* 100);
int number2=(int)(Math.random()* 100);
if(number1<number2)
{
int temp=number1;
number1=number2;
number2=number1;
}
System.out.println("what is"+number1+"-"+number2+"?");
int answer=input.nextInt();
if(number1-number2==answer)
{/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gess3;
/**
*
* @author I B M
*/
import javax.swing.JOptionPane;
import java.lang.Math;
import java.util.Scanner;
public class Gess3 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
final int Questions=5;
int cureectanswer=0;
int count=0;
long starttime=System. currentTimeMillis();
String output="";
Scanner input=new Scanner(System.in);
JOptionPane.showInputDialog(" enter student name");
//String b=input.nextLine();
JOptionPane.showInputDialog(" enter program");
//String d=input.nextLine();
JOptionPane.showInputDialog(" enter student roll");
//int c=input.nextInt();
JOptionPane.showMessageDialog( null,"total marks= 10");
while(count<Questions)
{
int number1=(int)(Math.random()* 100);
int number2=(int)(Math.random()* 100);
if(number1<number2)
{
int temp=number1;
number1=number2;
number2=number1;
}
int num;
String answer;
answer=JOptionPane. showInputDialog("what is"+number1+"-"+number2+"?");
//int answer=input.nextInt();
num=Integer.parseInt(answer);
if(number1-number2==num)
{
JOptionPane.showMessageDialog( null,"your answer is currect");
cureectanswer++;
}
else
JOptionPane.showMessageDialog( null,"Sorry yoour answer is wrong");
count++;
output += "\n"+number1+"-"+number2+"="+ num+((number1-number2==num)?" corect":"wrong");
long endtime=System. currentTimeMillis();
long testtime=endtime-starttime;
JOptionPane.showMessageDialog( null,"currect answer is="+cureectanswer+"\ntest time="+testtime/1000+"second"+ "\n marks you get="+cureectanswer*2);
}
}
}
System.out.println("your answer is currect");
cureectanswer++;
}
else
System.out.println("Sorry yoour answer is wrong");
count++;
output += "\n"+number1+"-"+number2+"="+ answer+((number1-number2== answer)?"corect":"wrong");
long endtime=System. currentTimeMillis();
long testtime=endtime-starttime;
System.out.println("currect answer is="+cureectanswer+"\ntest time="+testtime/1000+"second"+ "\n marks you get="+cureectanswer*2);
}
}
}
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gess3;
/**
*
* @author I B M
*/
import java.lang.Math;
import java.util.Scanner;
public class Gess3 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
final int Questions=5;
int cureectanswer=0;
int count=0;
long starttime=System.
String output="";
Scanner input=new Scanner(System.in);
System.out.println("enter student name");
String b=input.nextLine();
System.out.println("enter program");
String d=input.nextLine();
System.out.println("enter student roll");
int c=input.nextInt();
System.out.println("total marks= 10");
while(count<Questions)
{
int number1=(int)(Math.random()*
int number2=(int)(Math.random()*
if(number1<number2)
{
int temp=number1;
number1=number2;
number2=number1;
}
System.out.println("what is"+number1+"-"+number2+"?");
int answer=input.nextInt();
if(number1-number2==answer)
{/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package gess3;
/**
*
* @author I B M
*/
import javax.swing.JOptionPane;
import java.lang.Math;
import java.util.Scanner;
public class Gess3 {
/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here
final int Questions=5;
int cureectanswer=0;
int count=0;
long starttime=System.
String output="";
Scanner input=new Scanner(System.in);
JOptionPane.showInputDialog("
//String b=input.nextLine();
JOptionPane.showInputDialog("
//String d=input.nextLine();
JOptionPane.showInputDialog("
//int c=input.nextInt();
JOptionPane.showMessageDialog(
while(count<Questions)
{
int number1=(int)(Math.random()*
int number2=(int)(Math.random()*
if(number1<number2)
{
int temp=number1;
number1=number2;
number2=number1;
}
int num;
String answer;
answer=JOptionPane.
//int answer=input.nextInt();
num=Integer.parseInt(answer);
if(number1-number2==num)
{
JOptionPane.showMessageDialog(
cureectanswer++;
}
else
JOptionPane.showMessageDialog(
count++;
output += "\n"+number1+"-"+number2+"="+
long endtime=System.
long testtime=endtime-starttime;
JOptionPane.showMessageDialog(
}
}
}
System.out.println("your answer is currect");
cureectanswer++;
}
else
System.out.println("Sorry yoour answer is wrong");
count++;
output += "\n"+number1+"-"+number2+"="+
long endtime=System.
long testtime=endtime-starttime;
System.out.println("currect answer is="+cureectanswer+"\ntest time="+testtime/1000+"second"+
}
}
}