Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- import java.util.Random;
- public class Math {
- public static void main(String[] args) {
- Scanner in = new Scanner(System.in);
- Random randomGenerator = new Random();
- int x, t, j, f, b, c;
- j=0;
- f=0;
- int min = 3, max =10;
- System.out.println("Multiplication Test - by Hany Abboud..");
- for(t=1;t<11;t+=2)
- while(t<11){
- b = randomGenerator.nextInt(max-min) + min;
- c = randomGenerator.nextInt(max-min) + min;
- t++;
- System.out.println(b + "*" + c + "=");
- x = in.nextInt();
- if (b*c==x) {
- j++;
- System.out.println("Vraie..");
- } else {
- f++;
- System.out.println("Faux..La Bonne Reponse Est:"+ b*c);
- }
- if (f <= 1) {
- if (j <= 1) {
- System.out.println(j+" Reponse Est Correcte!"+ j + "/10");
- System.out.println(f+" Reponse Est Fausse!"+ f + "/10");
- } else{
- System.out.println(j+" Reponses Sont Correctes!"+ j + "/10");
- System.out.println(f+" Reponse Est Fausse!"+ f + "/10");
- }
- } else {
- if (j <= 1) {
- System.out.println(j+" Reponse Est Correcte!"+ j + "/10");
- System.out.println(f+" Reponses Sont Fausses!"+ f + "/10");
- } else {
- System.out.println(j+" Reponses Sont Correctes!"+ j + "/10");
- System.out.println(f+" Reponses Sont Fausses!"+ f + "/10");
- }
- }
- }
- int T=j*2;
- System.out.println("Ta Note Finale Est:"+ T +"/20");
- if(T>=10 && T<17){
- System.out.println("Bravo!!");
- }else if(T>17){
- System.out.println("Exellent!!");
- }else if(T<10){
- System.out.println("Courage,tu peux faire mieux!!");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement