PreAP Computer Science Quiz

Slides:



Advertisements
Similar presentations
PreAP Computer Science Quiz
Advertisements

1 Conditional Statement. 2 Conditional Statements Allow different sets of instructions to be executed depending on truth or falsity of a logical condition.
1 Chapter Five Selection and Repetition. 2 Objectives How to make decisions using the if statement How to make decisions using the if-else statement How.
Control Structures Corresponds with Chapters 3 and 4.
AP Computer Science DYRT Quiz Key
1 Powers of Two: Trace Ex. Print powers of 2 that are  2 N. Increment i from 0 to N. Double v each time. int i = 0; int v = 1; while (i
Branching Constructs Review l what are branching constructs? what type of branching constructs have we studied? l what is nested if? l what is multiway.
The UNIVERSITY of NORTH CAROLINA at CHAPEL HILL Adrian Ilie COMP 14 Introduction to Programming Adrian Ilie July 5, 2005.
Introduction to Computers and Programming Lecture 6 Professor: Evan Korth New York University.
C++ Programming: From Problem Analysis to Program Design, Third Edition Chapter 4: Control Structures I (Selection)
COMP 14 Introduction to Programming Miguel A. Otaduy May 20, 2004.
Computer Programming 1 Repetition. Computer Programming 2 Objectives Repetition structures Study while and do loops Examine for loops A practical example.
© 2004 Pearson Addison-Wesley. All rights reserved5-1 Iterations/ Loops The while Statement Other Repetition Statements.
Copyright © Texas Education Agency, Computer Programming For Loops.
COMP 110 Introduction to Programming Mr. Joshua Stough September 24, 2007.
PreAP Computer Science Quiz
PreAP Computer Science Quiz
CIS3931 – Intro to JAVA Lecture Note Set 3 19-May-05.
Section 5.1 Keyboard Input.
Program Statement Avoid Spaghetti Programming Program Statement.
PreAP Computer Science Quiz
Chapter 4: Decision Making with Control Structures and Statements JavaScript - Introductory.
C++ Programming: From Problem Analysis to Program Design, Fourth Edition Chapter 4: Control Structures I (Selection)
CPS120 Introduction to Computer Science Iteration (Looping)
CSCI 3328 Object Oriented Programming in C# Chapter 5: C# Control Statement – Part II UTPA – Fall
PreAP Computer Science Quiz
Computer Science Reading Quiz 6.2 (Sections )
PreAP Computer Science Review Quiz 08 Key
Making Decisions Chapter 5.  Thus far we have created classes and performed basic mathematical operations  Consider our ComputeArea.java program to.
Program Flow Program Flow follows the exact sequence of listed program statements, unless directed otherwise by a Java control structure.
1 CISC181 Introduction to Computer Science Dr. McCoy Lecture 7 Clicker Questions September 22, 2009.
Program Flow Control - Looping Addis Ababa Institute of Technology Yared Semu April 2012.
Lecture 4 Control Structures MIT – AITI What are Control Structures? Control structures are a way to alter the natural sequence of execution in.
Introduction to Programming Prof. Rommel Anthony Palomino Department of Computer Science and Information Technology Spring 2011.
Chapter 05 (Part III) Control Statements: Part II.
Chapter 15 JavaScript: Part III The Web Warrior Guide to Web Design Technologies.
Control Structures RepetitionorIterationorLooping Part I.
Quiz 3 is due Friday September 18 th Lab 6 is going to be lab practical hursSept_10/exampleLabFinal/
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 Key
Take out a piece of paper and PEN.
PreAP Computer Science Quiz
CONTROL STRUCTURE Chapter 3. CONTROL STRUCTURES ONE-WAY SELECTION Syntax: if (expression) statement Expression referred to as decision maker. Statement.
Repetition Statements (Loops). 2 Introduction to Loops We all know that much of the work a computer does is repeated many times. When a program repeats.
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.
Chapter 2: Fundamental Programming Structures in Java Adapted from MIT AITI Slides Control Structures.
CC213 Programming Applications Week #2 2 Control Structures Control structures –control the flow of execution in a program or function. Three basic control.
// Java0501.java // This program (and the next few programs) demonstrate user keyboard input // during program execution. This particular program demonstrates.
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.
ECE Application Programming
2.0 FUNDAMENTALS OF JAVA PROGRAMMING LANGUAGE
Pre-AP® Computer Science Quiz Key
Pre-AP® Computer Science Quiz
Take out a piece of paper and PEN.
Math Methods 2018 Allason McNamara
EECE.2160 ECE Application Programming
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.
Take out a piece of paper and PEN.
EECE.2160 ECE Application Programming
Control Statements Paritosh Srivastava.
Take out a piece of paper and PEN.
AP Computer Science DYRT Quiz
Take out a piece of paper and PEN.
Chapter 3: Selection Structures: Making Decisions
Pre-AP® Computer Science Quiz
Presentation transcript:

PreAP Computer Science Quiz 05.05- 09 Take out a piece of paper and PEN. The quiz starts ONE minute 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 05.05-09 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 01 Which of these is a real-life example of two-way selection? (a) (b) (c) (d)

Question 02 Which of these is a real-life example of multi-way selection? (a) (b) (c) (d)

Question 03 Which of these is a real-life example of fixed repetition? (a) (b) (c) (d)

Question 04 Which of these is a real-life example of conditional repetition? (a) (b) (c) (d)

Question 05 Repetition is also called I and II Conditional Branching Decision Making Iteration Looping I and II I and III I and IV II and III II and IV III and IV

Question 06 What type of control structure is used by the following program segment? double allowance = 20.0; if (grades >= 80) allowance += 10.0; one-way selection two-way selection multiple-way selection fixed repetition conditional repetition

Question 07 What type of control structure is used by the following program segment? for (int k = 1; k <= 100; k++) System.out.println("I will chew gum properly."); one-way selection two-way selection multiple-way selection fixed repetition conditional repetition

Question 08 What type of control structure is used by the following program segment? int pin = 0; while (pin != 54321) { System.out.print("Enter your 5-digit PIN ===>> "); pin = Expo.enterInt(); } one-way selection two-way selection multiple-way selection fixed repetition conditional repetition

Question 09 What type of control structure is used by the following program segment? switch (selection) { case 'A' : System.out.println("deposit"); break; case 'B' : System.out.println("withdrawal"); break; case 'C' : System.out.println("balance inquiry"); break; } one-way selection two-way selection multiple-way selection fixed repetition conditional repetition

Question 10 What type of control structure is used by the following program segment? if (sat < 1250) System.out.println("You are not admitted"); else System.out.println("You are admitted"); one-way selection two-way selection multiple-way selection fixed repetition conditional repetition

Question 11 The one-way selection control structure uses the _____ keyword. if else for while switch

Question 12 The two-way selection control structure uses the _____ keyword. do else for while switch

Question 13 The multiple-way selection control structure uses the _____ keyword. if else for while switch

Question 14 The fixed repetition control structure uses the _____ keyword. if else for while switch

Question 15 The conditional repetition control structure uses the _____ keyword. if else for while switch

Question 16 Which of these switch structures will have a strange output? switch (selection) // choice (a) { case 'A' : System.out.println("deposit"); case 'B' : System.out.println("withdrawal"); case 'C' : System.out.println("balance inquiry"); } switch (selection) // choice (b) case 'A' : System.out.println("deposit"); break; case 'B' : System.out.println("withdrawal"); break;

Question 17 True or False: One problem with the switch command is that each case can only control a single programming statement. True False

Question 18 True or False: break must always be used with default.

Question 19 True or False: If your switch structure does not use default, then you do not need a break after the last case. True False

Question 20 True or False: In a switch structure, multiple cases can yield the same outcome. True False

Question 21 Which of these data types work with switch? boolean I only char double int String I only II only II and IV only II and V only III and IV only II, IV and V only I, II, III, IV & V

Question 22 Which of these commands is used with switch? case I only break default I only I and II only I and III only II and III only I, II and III

Question 23 How do you control multiple program statements with an if, for or while control structure? Put the statements inside parentheses ( ). Put the statements inside brackets [ ]. Put the statements inside angle brackets < >. Put the statements inside braces { }.

Question 24 A for loop needs a counter. What is technical name for this counter? Loop Counting Constant Loop Control Constant Loop Counting Variable Loop Control Variable There is none. It’s just called a counter.

Question 25 When creating a loop, what is the flag? A special value that makes the loop start A special value that makes the loop stop A special value that makes the loop continue A special value that never changes in the loop

Extra Credit What is the output of the following segment? int count = 100; for (int k = 1; k < 10; k++) count = count + 3; System.out.println(count); 109 110 124 127 130