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.

Slides:



Advertisements
Similar presentations
Parameter passing mechanism: pass-by-reference. The Pass-by-reference mechanism - the agreement Recall: Parameter passing mechanism = agreement between.
Advertisements

PreAP Computer Science Quiz
Visual Classes 1 Class: Bug 5 Objects: All Bug Objects.
AP Computer Science DYRT Quiz Key
Loops (Part 1) Computer Science Erwin High School Fall 2014.
PreAP Computer Science Quiz
Today’s Mental Math Write the date and number 1-10 Today’s title: MM #13 Practice Quiz It will start in 2 minutes and 0 seconds It will start in 1 minute.
Be Rational! Clipboard Math #20 **EXPLAIN how you picked your answer.
PreAP Computer Science Quiz
PreAP Computer Science Quiz
MATH AND RANDOM CLASSES.  The need for random numbers occurs frequently when writing software.  The Random class, which is part of the java.util class,
PreAP Computer Science Quiz
Computer Science Reading Quiz 6.2 (Sections )
PreAP Computer Science Review Quiz 08 Key
Mathematics Arithmetic Sequences Science and Mathematics Education Research Group Supported by UBC Teaching and Learning Enhancement Fund Department.
PreAP Computer Science Quiz Key
Introduction to Computer Programming Math Random Dice.
Advanced Computer Science Lesson 4: Reviewing Loops and Arrays Reading User Input.
ReviewNum1 { Hardware, Binary, Java, BlueJ, Variables, Classes, Arithmetic, Print Statements, Errors, Boolean Expressions, Conditionals, Loops, Random.
PreAP Computer Science Quiz
Visual Classes 1 Class: Bug 5 Objects: All Bug Objects.
AP Computer Science DYRT Quiz Key
CSE 201 – Elementary Computer Programming 1 Extra Exercises Sourceshttp://
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
AP Computer Science DYRT Quiz
Take out a piece of paper and PEN.
PreAP Computer Science Quiz
Let’s not leave anything to chance. How that process to generate random numbers takes places requires some complicated statistics that are outside the.
Midterm preview. double int = 2.0; True / FalseThe following is a syntactically correct variable declaration and assignment statement:
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.
AP Computer Science DYRT Quiz
MR. CRONE Generating Random Numbers. Random Numbers Many programs require the computer to generate random numbers Random numbers are used in many applications.
Question 01 Which of the following can be stored by a simple or primitive data type? (a)Only 1 single value (b)Only Attributes (c)Only Methods (d)Both.
Debugging and Testing Hussein Suleman March 2007 UCT Department of Computer Science Computer Science 1015F.
CSCI/CMPE 4341 Topic: Programming in Python Chapter 5: Functions – Exercises Xiang Lian The University of Texas – Pan American Edinburg, TX 78539

Conditional Branching
3-3 Side Effects A side effect is an action that results from the evaluation of an expression. For example, in an assignment, C first evaluates the expression.
TO COMPLETE THE FOLLOWING:
Pre-AP® Computer Science Quiz Key
Pre-AP® Computer Science Quiz
PowerPoint Presentation Authors of Exposure Java
Section 6.2 Classes & Objects.
Take out a piece of paper and PEN.
Turn in your Homework to the box before the tardy bell rings.
PreAP Computer Science Review Quiz 08
CS150 Introduction to Computer Science 1
PreAP Computer Science Quiz Key
Programming Concepts and Database
Take out a piece of paper and PEN.
Click on the icon above to hear the narration.
PreAP Computer Science Quiz
Click on the icon above to hear the narration.
Take out a piece of paper and PEN.
Take out a piece of paper and PEN.
Final Exam Review CSE113.
Click on the icon above to hear the narration.
QUIZ 5 – RESULT.
Take out a piece of paper and PEN.
AP Computer Science DYRT Quiz
Take out a piece of paper and PEN.
Types of loops definite loop: A loop that executes a known number of times. Examples: Repeat these statements 10 times. Repeat these statements k times.
Click on the icon above to hear the narration.
Independent Variables Click on the icon above to hear the narration.
Click on the icon above to hear the narration.
Pre-AP® Computer Science Quiz
Click on the icon above to hear the narration.
Presentation transcript:

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 Teaching AP ® Computer Science DYRT Quiz

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

Question 01 In the statement int x; What is int ? (a)a variable (b)a data type (c)a class (d)an object

Question 02 In the statement int x; What is x ? (a)a variable (b)a data type (c)a class (d)an object

Question 03 In the statement Bank tom = new Bank(5000.0); Which is the class? (a)Bank (b)tom (c)new (d)5000.0

Question 04 In the statement Bank tom = new Bank(5000.0); Which is the object? (a)Bank (b)tom (c)new (d)5000.0

Question 05 How many classes are being shown in this example? (a)1 (b)2 (c)3 (d)4 (e)5 (f)10 (g)13

Question 06 How many objects are being shown in this example? (a)1 (b)2 (c)3 (d)4 (e)5 (f)10 (g)13

Question 07 Which of these statements will cause a different set of random numbers to be generated every time the program is executed? (a)Random rand = new Random(); (b)Random rand = new Random(40); (c)Random rand = new Random(12345); (d)All of the above

Question 08 Assume rand is an object of the Random class. What is the output of this statement? System.out.println(rand.nextInt(1000)); (a)1000 (b)a random number from 1 to 1000 (c)a random number from 0 to 1000 (d)a random number from 1 to 999 (e)a random number from 0 to 999

Question 09 Assume rand is an object of the Random class. What is the output of this statement? System.out.println(rand.nextInt(1001)); (a)1001 (b)a random number from 1 to 1000 (c)a random number from 0 to 1000 (d)a random number from 1 to 999 (e)a random number from 0 to 999

Question 10 Assume rand is an object of the Random class. What is the output of this program segment? int x = rand.nextInt(1000) + 1; System.out.println(x); (a)1001 (b)a random number from 1 to 1000 (c)a random number from 0 to 1000 (d)a random number from 1 to 999 (e)a random number from 0 to 999

Question 11 Which of the following are methods of the Random class? (a)nextInt (b)nextDouble (c)setSeed (d)All of the above

Question 12 The random method of the Math class behaves Just like the _____ method of the _____ class. (a)nextRnd Random (b)nextDouble Random (c)nextRandomDice (d)nextIntInteger

Question 13 The Math.random() method generates a random number x, such that (a)0 < x < 1 (b)0 <= x < 1 (c)0 <= x <= 1 (d)0 < x <= 1

Question 14 What is the output of the following statement? System.out.println( (int) (100 * Math.random() ); (a)An integer in the [1..100] range (b)An integer in the [0..100] range (c)An integer in the [1..99] range (d)An integer in the [0..99] range

Question 15 Assume rand is an object of the Random class. Which of the following statements will cause x to have a random value between 100 and 500? (a) int x = rand.nextInt(500) + 100; (b) int x = rand.nextInt(100) + 500; (c) int x = rand.nextInt(400) + 100; (d) int x = rand.nextInt(401) + 100; (e) int x = rand.nextInt(100) + 401;

Extra Credit Assume rand is an object of the Random class. Which of the following statements will cause x to have a random value in the same range as this statement: int x = rand.nextInt(1001) + 500; (a) int x = Math.random(1001) + 500; (b) int x = (int) (Math.random() * ); (c) int x = Math.random(1600) + 500; (d) int x = Math.random() * ; (e) int x = (int) (Math.random() * );