-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathquiz.java
More file actions
59 lines (59 loc) · 1.81 KB
/
quiz.java
File metadata and controls
59 lines (59 loc) · 1.81 KB
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
import java.util.*;//imports console reading methods
public class quiz {
public static void main(String[] args){
quiz();//all methods need a cool name
}
public static void quiz(){
boolean hard = false;//initializes boolean for hard question, since getting it right is a T/F
Scanner console=new Scanner(System.in);//analysezz inputzz
System.out.println("What is f'(2) if f(x)=2x^5?");
int q1=console.nextInt();//gets input from console
System.out.println("What is f''(2) if f(x)=2x^5?");//unfortunately my questions are a bit.. derivative
int q2=console.nextInt();//gets input from console
System.out.println("What is f(2) if f'(x)=2x^5 and c = 0?");//decided to integrate a little harder question
double q3=console.nextDouble();//gets input from console
int correct = 0;
if(q1 == 160){
correct = correct +1;//increments # of correct awnsers by one if correct
}
else{
System.out.println("The correct awnser for #1 is 160");//prints correct awnser if wrong
}
if(q2 == 320){
correct = correct +1;
}
else{
System.out.println("The correct awnser for #2 is 320");
}
if(q3 == 12.8){
correct = correct +1;
hard = true;
}
else{
System.out.println("The correct awnser for #3 is 12.8");
}
if(correct==0){
System.out.println("Are you sure you're not from Green River?");
}
if(correct==1){
if(hard == true){
System.out.println("You may have passed Calc 2, but where were you in Calc 1?");
}
else{
System.out.println("You may want to consider that degree in literary criticism.");
}
}
else if(correct==2){
if(hard == true){
System.out.println("Derivatives appearently weren't integral to your sucess.");
}
else{
System.out.println("You need to step it up, Math 151 rookie!");
}
}
else{
System.out.println("You looked at the source code!");
}
}
}//greatness within this curly bracket
//EOF