-
Notifications
You must be signed in to change notification settings - Fork 0
/
Computer assisted instruction
90 lines (63 loc) · 2.51 KB
/
Computer assisted instruction
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
//<Assignment4Project3> -- computer assisted instruction
//CSIS 212-Module/Week 4
//<Citations> -- I used the book
import java.util.Scanner;
import java.security.SecureRandom;
public class Assignment4Project3 {
public static void main(String[] args) {
System.out.println("Lisa Tidball - Assignment1\n");
Scanner input = new Scanner(System.in);
int answer;
//Getting a random number
SecureRandom randomNumbers = new SecureRandom();
int randomValue = randomNumbers.nextInt();
}//end main
public static void math(){
Scanner input = new Scanner(System.in);
int answer;
//prints out the first question
System.out.println("How much is 6 times 7?");
answer = input.nextInt();
//figuring out if the answer is correct
if ( answer == 42)
System.out.println("Very good");
else
System.out.println("No, Please try again");
}//end math
public static void math2(){
Scanner input = new Scanner(System.in);
int answer2;
//prints out the second question
System.out.println("How much is 8 times 7?");
answer2 = input.nextInt();
//figuring out if the answer is correct
if (answer2 == 56)
System.out.println("Very good");
else
System.out.println("No, Please try again");
}//end math2
public static void math3(){
Scanner input = new Scanner(System.in);
int answer3;
//asking the third question
System.out.println("How much is 9 times 9?");
answer3 = input.nextInt();
//figuring out if the answer is correct
if (answer3 == 81)
System.out.println("Very good");
else
System.out.println("No, Please try again");
}//end math3
public static void math4(){
Scanner input = new Scanner(System.in);
int answer4;
//asking the third question
System.out.println("How much is 8 times 9?");
answer4 = input.nextInt();
//figuring out if the answer is correct
if (answer4 == 72)
System.out.println("Very good");
else
System.out.println("No, Please try again");
}//end math4
}//end class