Presentation is loading. Please wait.

Presentation is loading. Please wait.

PreAP Computer Science Quiz

Similar presentations


Presentation on theme: "PreAP Computer Science Quiz"— Presentation transcript:

1 PreAP Computer Science Quiz 10.01- 08
Take out a piece of paper and PEN. The quiz starts ONE minute after the tardy bell rings. You will have between 20 and 45 seconds per question.

2 Title the quiz as shown below The quiz starts in ONE minute.
Name Period Date Quiz EC.

3 Question 1 Which of the following is NOT a Boolean statement?
2 + 2 = 4 Today is Friday. The 2008 Hulk movie is better than the 2003 Hulk movie. (D) In Java, a boolean data type can store one of 3 values: true, false, or maybe.

4 Question 2 Which of the following is a Boolean statement?
New York has the best operas. Paris is the capital of Texas. The Dallas Cowboys have the best football team. (D) Kings and queens run better governments than presidents. 4

5 Question 3 (A) + (E) && (B) * (F) || (C) ~ (G) ! (D) ⊕ (H) !=
Which of the following is shorthand notation for AND? (A) + (E) && (B) * (F) || (C) ~ (G) ! (D) ⊕ (H) != 5

6 Question 4 (A) + (E) && (B) * (F) || (C) ~ (G) ! (D) ⊕ (H) !=
Which of the following is the Java operator for AND? (A) + (E) && (B) * (F) || (C) ~ (G) ! (D) ⊕ (H) != 6

7 Question 5 (A) + (E) && (B) * (F) || (C) ~ (G) ! (D) ⊕ (H) !=
Which of the following is shorthand notation for OR? (A) + (E) && (B) * (F) || (C) ~ (G) ! (D) ⊕ (H) != 7

8 Question 6 (A) + (E) && (B) * (F) || (C) ~ (G) ! (D) ⊕ (H) !=
Which of the following is the Java operator for OR? (A) + (E) && (B) * (F) || (C) ~ (G) ! (D) ⊕ (H) != 8

9 Question 7 (A) + (E) && (B) * (F) || (C) ~ (G) ! (D) ⊕ (H) !=
Which of the following is shorthand notation for XOR? (A) + (E) && (B) * (F) || (C) ~ (G) ! (D) ⊕ (H) != 9

10 Question 8 (A) + (E) && (B) * (F) || (C) ~ (G) ! (D) ⊕ (H) !=
Which of the following is the Java operator for XOR? (A) + (E) && (B) * (F) || (C) ~ (G) ! (D) ⊕ (H) != 10

11 Question 9 (A) + (E) && (B) * (F) || (C) ~ (G) ! (D) ⊕ (H) !=
Which of the following is shorthand notation for NOT? (A) + (E) && (B) * (F) || (C) ~ (G) ! (D) ⊕ (H) != 11

12 Question 10 (A) + (E) && (B) * (F) || (C) ~ (G) ! (D) ⊕ (H) !=
Which of the following is the Java operator for NOT? (A) + (E) && (B) * (F) || (C) ~ (G) ! (D) ⊕ (H) != 12

13 The rectangle represents all the students at JPIIHS.
Question 11 The rectangle represents all the students at JPIIHS. Let A = All of the students who are in athletics. Let B = All of the students who are in fine arts. What does the chart on the right represent? All of the students who are in athletics. All of the students who are NOT in athletics. All of the students who are in athletics and/or fine arts. All of the students who are in BOTH athletics & fine arts. All of the students who are either in athletics, or fine arts, BUT NOT BOTH.

14 The rectangle represents all the students at JPIIHS.
Question 12 The rectangle represents all the students at JPIIHS. Let A = All of the students who are in athletics. Let B = All of the students who are in fine arts. What does the chart on the right represent? All of the students who are in athletics. All of the students who are NOT in athletics. All of the students who are in athletics and/or fine arts. All of the students who are in BOTH athletics & fine arts All of the students who are either in athletics, or fine arts, BUT NOT BOTH.

15 The rectangle represents all the students at JPIIHS.
Question 13 The rectangle represents all the students at JPIIHS. Let A = All of the students who are in athletics. Let B = All of the students who are in fine arts. What does the chart on the right represent? All of the students who are in athletics. All of the students who are NOT in athletics. All of the students who are in athletics and/or fine arts. All of the students who are in BOTH athletics & fine arts. All of the students who are either in athletics, or fine arts, BUT NOT BOTH.

16 The rectangle represents all the students at JPIIHS.
Question 14 The rectangle represents all the students at JPIIHS. Let A = All of the students who are in athletics. Let B = All of the students who are in fine arts. What does the chart on the right represent? All of the students who are in athletics. All of the students who are NOT in athletics. All of the students who are in athletics and/or fine arts. All of the students who are in BOTH athletics & fine arts. All of the students who are either in athletics, or fine arts, BUT NOT BOTH.

17 The rectangle represents all the students at JPIIHS.
Question 15 The rectangle represents all the students at JPIIHS. Let A = All of the students who are in athletics. Let B = All of the students who are in fine arts. What does the chart on the right represent? All of the students who are in athletics. All of the students who are NOT in athletics. All of the students who are in athletics and/or fine arts. All of the students who are in BOTH athletics & fine arts. All of the students who are either in athletics, or fine arts, BUT NOT BOTH.

18 This program segment is from a college admissions program.
Question 16 This program segment is from a college admissions program. What would be the output after the user enters 1200 followed by 18? System.out.print("Enter SAT score. "); int sat = Expo.enterInt(); System.out.print("Enter class rank. "); int rank = Expo.enterInt(); if (sat >= 1100 || rank < 25) System.out.println("You are admitted."); else System.out.println("Try another college."); (a) You are admitted. (b) You are not admitted. (c) Try another college.

19 This program segment is from a college admissions program.
Question 17 This program segment is from a college admissions program. What would be the output after the user enters 900 followed by 24? System.out.print("Enter SAT score. "); int sat = Expo.enterInt(); System.out.print("Enter class rank. "); int rank = Expo.enterInt(); if (sat >= 1100 || rank < 25) System.out.println("You are admitted."); else System.out.println("Try another college."); (a) You are admitted. (b) You are not admitted. (c) Try another college.

20 This program segment is from a college admissions program.
Question 18 This program segment is from a college admissions program. What would be the output after the user enters 1100 followed by 30? System.out.print("Enter SAT score. "); int sat = Expo.enterInt(); System.out.print("Enter class rank. "); int rank = Expo.enterInt(); if (sat >= 1100 || rank < 25) System.out.println("You are admitted."); else System.out.println("Try another college."); (a) You are admitted. (b) You are not admitted. (c) Try another college.

21 This program segment is from a college admissions program.
Question 19 This program segment is from a college admissions program. What would be the output after the user enters 1099 followed by 26? System.out.print("Enter SAT score. "); int sat = Expo.enterInt(); System.out.print("Enter class rank. "); int rank = Expo.enterInt(); if (sat >= 1100 || rank < 25) System.out.println("You are admitted."); else System.out.println("Try another college."); (a) You are admitted. (b) You are not admitted. (c) Try another college.

22 This program segment is from a college admissions program.
Question 20 This program segment is from a college admissions program. What would be the output after the user enters 1600 followed by 1? System.out.print("Enter SAT score. "); int sat = Expo.enterInt(); System.out.print("Enter class rank. "); int rank = Expo.enterInt(); if (sat >= 1100 && rank < 25) System.out.println("You are admitted."); else System.out.println("Try another college."); (a) You are admitted. (b) You are not admitted. (c) Try another college.

23 This program segment is from a college admissions program.
Question 21 This program segment is from a college admissions program. What would be the output after the user enters 1100 followed by 25? System.out.print("Enter SAT score. "); int sat = Expo.enterInt(); System.out.print("Enter class rank. "); int rank = Expo.enterInt(); if (sat >= 1100 && rank < 25) System.out.println("You are admitted."); else System.out.println("Try another college."); (a) You are admitted. (b) You are not admitted. (c) Try another college.

24 This program segment is from a college admissions program.
Question 22 This program segment is from a college admissions program. What would be the output after the user enters 1500 followed by 10? System.out.print("Enter SAT score. "); int sat = Expo.enterInt(); System.out.print("Enter class rank. "); int rank = Expo.enterInt(); if (sat >= 1100 != rank < 25) System.out.println("You are admitted."); else System.out.println("Try another college."); (a) You are admitted. (b) You are not admitted. (c) Try another college.

25 This program segment is from a college admissions program.
Question 23 This program segment is from a college admissions program. What would be the output after the user enters 1200 followed by 30? System.out.print("Enter SAT score. "); int sat = Expo.enterInt(); System.out.print("Enter class rank. "); int rank = Expo.enterInt(); if (sat >= 1100 != rank < 25) System.out.println("You are admitted."); else System.out.println("Try another college."); (a) You are admitted. (b) You are not admitted. (c) Try another college.

26 What is the output of this program segment?
Question 24 What is the output of this program segment? double average = 90; if (x > 90) System.out.println(“You earned an A.”); else if (x > 80) System.out.println(“You earned a B.”); else if (x > 70) System.out.println(“You earned a C.”); else System.out.println(“You fail.”); (a) You earned an A. (b) You earned a B. (c) You earned a C. (d) You fail.

27 Question 25 Which of the following will properly check to see if someone is between 21 and 100 years old? (Note: This includes the people who are 21 or 100.) if (age > 21 || age < 100) if (age > 21 && age < 100) if (age >= 21 || age <= 100) if (age >= 21 && age <= 100)

28 What is the flag for this while loop? boolean valid = false;
Extra Credit What is the flag for this while loop? boolean valid = false; while (!valid) { System.out.print("Enter grade: "); int grade = Expo.enterInt( ); valid = (grade >= 0 && grade <= 100); } The user enters a grade that is negative. The user enters a grade that is positive. The user enters a grade that is less than 100. The user enters a grade between 0 and 100. 28


Download ppt "PreAP Computer Science Quiz"

Similar presentations


Ads by Google