Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.io.*;
- import static java.lang.System.*;
- import java.util.Scanner;
- import java.lang.Math;
- public class Lesson_13_Activity_Five {
- public static void main (String str []) throws IOException {
- Scanner scanner = new Scanner(System.in);
- double x;
- double y;
- double z;
- double a;
- x = (int)(Math.random() * (12) + 1);
- y = (int)(Math.random() * (12) + 1);
- a = (int)(x * y);
- System.out.println(x + " * " + y);
- System.out.println("What is the answer?");
- z = scanner.nextDouble();
- if(a == z){
- System.out.println("Correct!");
- }
- else{
- System.out.println("Wrong");
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement