PreAP Computer Science Quiz

Slides:



Advertisements
Similar presentations
PreAP Computer Science Quiz
Advertisements

BUILDING JAVA PROGRAMS CHAPTER 4 Conditional Execution.
Some revision.  Today, we will do some revision on: - ◦ booleans, and ◦ if statements.
1 9/29/06CS150 Introduction to Computer Science 1 Loops Section Page 255.
1 9/28/07CS150 Introduction to Computer Science 1 Loops section 5.2, 5.4, 5.7.
Introduction to Computers and Programming Lecture 5 New York University.
Introduction to Computer Programming Decisions If/Else Booleans.
1 Selection in C. 2 If / else if statement:  The else part of an if statement can be another if statement. if (condition) … else if (condition) … else.
CS 106 Introduction to Computer Science I 02 / 20 / 2008 Instructor: Michael Eckmann.
1 Arithmetic in C. 2 Type Casting: STOPPED You can change the data type of the variable in an expression by: (data_Type) Variable_Name Ex: int a = 15;
PreAP Computer Science Quiz
PreAP Computer Science Quiz
CPS 2231 Computer Organization and Programming Instructor: Tian (Tina) Tian.
1.7 Logical Reasoning Conditional statements – written in the form If A, then B. Statements in this form are called if-then statements. – Ex. If the popcorn.
Selection (if-then-else) Programming Has 3 Types of Control: Sequential (normal): Control of Execution Proceeds One after the Other Selection (if-then-else):
George Boole More than 150 years ago, there was a mathematician named George Boole, who took statements and wrote them in a precise format, such that.
1. We’ve learned that our programs are read by the compiler in order, from top to bottom, just as they are written The order of statement execution is.
PreAP Computer Science Quiz
Computer Science Reading Quiz 6.2 (Sections )
CSCI S-1 Section 6. Coming Soon Homework Part A – Friday, July 10, 17:00 EST Homework Part B – Tuesday, July 14, 17:00 EST Mid-Term Quiz Review – Friday,
PreAP Computer Science Review Quiz 08 Key
Program Flow Program Flow follows the exact sequence of listed program statements, unless directed otherwise by a Java control structure.
PreAP Computer Science Quiz Key
Building Java Programs
George Boole More than 150 years ago, there was a mathematician named George Boole, who took statements and wrote them in a precise format, such that.
1 09/20/04CS150 Introduction to Computer Science 1 Let ’ s all Repeat Together.
Team C Social Studies.  CHECK for prior knowledge -what do I KNOW NOW?  CHECK for understanding -what have I LEARNED?  PRACTICE important skills 
CSE 1341 Honors Note Set 05 Professor Mark Fontenot Southern Methodist University.
Lecture 2 Conditional Statement. chcslonline.org Conditional Statements in PHP Conditional Statements are used for decision making. Different actions.
PreAP Computer Science Quiz
Take out a piece of paper and PEN. The quiz starts ONE minute after the tardy bell rings. You will have 45 – 90 seconds per question. Determine the output.
PreAP Computer Science Quiz
PreAP Computer Science Quiz Key
Take out a piece of paper and PEN.
PreAP Computer Science Quiz
Midterm preview. double int = 2.0; True / FalseThe following is a syntactically correct variable declaration and assignment statement:
Midterm 2 Review. Stars and why we use nested loops  Matrix problems (stars)  Other problems involving multiple dimensions  Loops within a process.
Take out a piece of paper and PEN.
PreAP Computer Science Quiz Take out a piece of paper and PEN. The quiz starts ONE minute after the tardy bell rings. You will have 30 – 60 seconds.
Java Scanner Class Keyboard Class. User Interaction So far when we created a program there was no human interaction Our programs just simply showed one.
AP Computer Science DYRT Quiz
COLLEGE ADMISSION TEST SCORES Student IDReadingWritingMathTotal S S S S S
CSC 1051 – Data Structures and Algorithms I Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Course website:
George Boole More than 150 years ago, there was a mathematician named George Boole, who took statements and wrote them in a precise format, such that.
Take out a piece of paper and PEN. The quiz starts TWO minutes after the tardy bell rings. You will have 30 seconds per question. Exposure Java 2014 for.
CS0007: Introduction to Computer Programming
CSC111 Quick Revision.
CIS3931 – Intro to JAVA Lecture Note Set 2 17-May-05.
Pre-AP® Computer Science Quiz Key
Pre-AP® Computer Science Quiz
Take out a piece of paper and PEN.
PreAP Computer Science Review Quiz 08
PreAP Computer Science Quiz Key
CS2011 Introduction to Programming I Selections (I)
Take out a piece of paper and PEN.
PreAP Computer Science Quiz
Take out a piece of paper and PEN.
CS150 Introduction to Computer Science 1
Take out a piece of paper and PEN.
Take out a piece of paper and PEN.
AP Computer Science DYRT Quiz
Take out a piece of paper and PEN.
CS150 Introduction to Computer Science 1
Announcements Lab 3 was due today Assignment 2 due next Wednesday
Consider Write a program that prompts a user to enter the number of students and then, their names and grades. The program will then outputs the average.
Dry Run Fix it Write a program
Flow of Control Flow of control is the order in which a program performs actions. Up to this point, the order has been sequential. A branching statement.
1. Take the sheet from the middle of your table
Pre-AP® Computer Science Quiz
Exploring Computer Science Lesson 4-10 – Part 1
Presentation transcript:

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.

Title the quiz as shown below The quiz starts in ONE minute. Name Period Date Quiz 10.01-08 1. 14. 2. 15. 3. 16. 4. 17. 5. 18. 6. 19. 7. 20. 8. 21. 9. 22. 10. 23. 11. 24. 12. 25. 13. EC.

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.

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

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

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

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

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

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

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

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

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

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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.

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)

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