Take out a piece of paper and PEN.

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
Classes  All code in a Java program is part of a class  A class has two purposes  Provide functions to do work for the programmer  Represent data.
Chapter 7 User-Defined Methods. Chapter Objectives  Understand how methods are used in Java programming  Learn about standard (predefined) methods and.
Java Planning our Programs Flowcharts Arithmetic Operators.
Primitive Data Types and Operations. Introducing Programming with an Example public class ComputeArea { /** Main method */ public static void main(String[]
Access to Names Namespaces, Scopes, Access privileges.
COMP 14 Introduction to Programming Miguel A. Otaduy May 25, 2004.
1 Chapter 7 User-Defined Methods Java Programming from Thomson Course Tech, adopted by kcluk.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Adrian Ilie COMP 14 Introduction to Programming Adrian Ilie July 8, 2005.
1 Memory Model of A Program, Methods Overview l Closer Look at Methods l Memory Model of JVM »Method Area »Heap »Stack l Preview: Parameter Passing.
Fundamental Programming Structures in Java: Comments, Data Types, Variables, Assignments, Operators.
Sadegh Aliakbary Sharif University of Technology Spring 2011.
By Nicholas Policelli An Introduction to Java. Basic Program Structure public class ClassName { public static void main(String[] args) { program statements.
The Java Programming Language
PreAP Computer Science Quiz
Java Quiz Bowl A fun review of the Java you should know from CMPT 201 If you don’t know the answers - this week is for you to study up!
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 5: Software Design & Testing; Revision Session.
What does a computer program look like: a general overview.
Objective You will be able to define and identify the basic components of a java program by taking notes, seeing examples, and completing a lab. Construction.
PreAP Computer Science Review Quiz 08 Key
PreAP Computer Science Quiz Key
CIS 260: App Dev I. 2 Programs and Programming n Program  A sequence of steps designed to accomplish a task n Program design  A detailed _____ for implementing.
BEGINNING PROGRAMMING.  Literally – giving instructions to a computer so that it does what you want  Practically – using a programming language (such.
Anatomy of a Java Program. AnotherQuote.java 1 /** A basic java program 2 * 3 Nancy Harris, James Madison University 4 V1 6/2010.
1 Chapter 6 Methods. 2 Motivation Find the sum of integers from 1 to 10, from 20 to 30, and from 35 to 45, respectively.
User Defined Methods Methods are used to divide complicated programs into manageable pieces. There are predefined methods (methods that are already provided.
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.
Take out a piece of paper and PEN.
PreAP Computer Science Quiz
Take out a piece of paper and PEN.
Classes - Intermediate
Methods.
Computer Science A 1. Course plan Introduction to programming Basic concepts of typical programming languages. Tools: compiler, editor, integrated editor,
Methods What is a method? Main Method the main method is where a stand alone Java program normally begins execution common compile error, trying.
AP Computer Science DYRT Quiz
Question 01 Return methods always (a)calculate some mathematical formula. (b)display a value. (c)return a value. (d)use numerical values.
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.
Midterm preview.
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.
Computer Programming Your First Java Program: HelloWorld.java.
User-Written Functions
Chapter 7 User-Defined Methods.
PowerPoint Presentation Authors of Exposure Java
Introduction to Computer Science / Procedural – 67130
FUNDAMENTALS OF JAVA.
Chapter 2.
Pre-AP® Computer Science Quiz Key
Pre-AP® Computer Science Quiz
Group Status Project Status.
Chapter 1: Computer Systems
Method Overloading in JAVA
CS2011 Introduction to Programming I Methods (II)
Chap 1 Chap 2 Chap 3 Chap 5 Surprise Me
Chapter 6 Methods.
BBIT 212/ CISY 111 Object Oriented Programming (OOP)
Anatomy of a Java Program
PreAP Computer Science Review Quiz 08
PreAP Computer Science Quiz Key
Take out a piece of paper and PEN.
PreAP Computer Science Quiz
Take out a piece of paper and PEN.
Fundamental OOP Programming Structures in Java: Comments, Data Types, Variables, Assignments, Operators.
Take out a piece of paper and PEN.
In this class, we will cover:
Take out a piece of paper and PEN.
AP Computer Science DYRT Quiz
Take out a piece of paper and PEN.
Pre-AP® Computer Science Quiz
Presentation transcript:

Take out a piece of paper and PEN. Exposure Java 2015 for Teaching AP® Computer Science DYRT Quiz 07.06-12 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.

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

Question 01 double number = 6.25; double result = Math.sqrt(number); What type of parameter is number in this program segment? double number = 6.25; double result = Math.sqrt(number); actual parameter formal parameter class parameter receiving parameter

Question 02 public static void sum(int n1, int n2) What type of parameters are n1 and n2 ? public static void sum(int n1, int n2) actual parameters formal parameters class parameters receiving parameters

Question 03 Return methods always calculate some mathematical formula. display a value. return a value. use numerical values.

Question 04 What type of method is written below? public static void add(int n1, int n2) { System.out.println(n1 + n2); } return method add method void method print method

Question 05 What type of method is written below? public static int add(int n1, int n2) { return n1 + n2; } return method add method void method print method

Question 06 What type of method is the main method? return method add method void method print method

Question 07 Java’s Math class contains __________ methods. void class void object return class return object

Question 08 Java’s Graphics class contains __________ methods. class math object String

Question 09 Which of the following is wrong with the first stage of the Payroll Case Study? There is no readable program format. The variable identifiers make no sense. All the program statements are in one module. All of the above

Question 10 The first stage, and very poorly written, Payroll Case Study program does not compile. compiles, but executes incorrectly. compiles and executes. cannot be improved.

Question 11 Which of the following is an example of a good self-commenting identifier? qwerty k netPay public

Question 12 Which of the following is/are true about designing a program? Use self-commenting identifiers. Use consistent indentation style. Don't place many program statements in the main method. Specific tasks should be placed in modules called methods. Similar methods accessing the same data should be placed in their own class. All of the above

Question 13 What kind of variable is x? local variable class variable public class Quiz7613 { static String z = "Bob"; public static void main(String args[]) int x = 7; . . . . } public static void qwerty() char y = '?'; Question 13 What kind of variable is x? local variable class variable final variable

Question 14 What kind of variable is y? local variable class variable public class Quiz7614 { static String z = "Bob"; public static void main(String args[]) int x = 7; . . . . } public static void qwerty() char y = '?'; Question 14 What kind of variable is y? local variable class variable final variable

Question 15 What kind of variable is z? local variable class variable public class Quiz7615 { static String z = "Bob"; public static void main(String args[]) int x = 7; . . . . } public static void qwerty() char y = '?'; Question 15 What kind of variable is z? local variable class variable final variable

Question 16 Where can the variable x be used? the main method public class Quiz7616 { static String z = "Bob"; public static void main(String args[]) int x = 7; . . . . } public static void qwerty() char y = '?'; Question 16 Where can the variable x be used? the main method the qwerty method entire Quiz7612 class

Question 17 Where can the variable y be used? the main method public class Quiz7617 { static String z; public static void main(String args[]) int x = 7; . . . . } public static void qwerty() char y = '?'; Question 17 Where can the variable y be used? the main method the qwerty method entire Quiz7612 class

Question 18 Where can the variable z be used? the main method public class Quiz7618 { static String z; public static void main(String args[]) int x = 7; . . . . } public static void qwerty() char y = '?'; Question 18 Where can the variable z be used? the main method the qwerty method entire Quiz7612 class

Question 19 When a program has multiple classes, which one is called the Driving Class? The class with the same name as the file. The class with the most methods. The class with the least number of methods. The class with the main method.

Question 20 Which of these is a synonym for Class Variable? attribute final variable local variable parameter