Test Review. General Info. All tests will be comprehensive. You will be tested more on your understanding of code as opposed to your ability to write.

Slides:



Advertisements
Similar presentations
AP Computer Science Anthony Keen. Computer 101 What happens when you turn a computer on? –BIOS tries to start a system loader –A system loader tries to.
Advertisements

Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 3: Flow Control I: For Loops.
STRING AN EXAMPLE OF REFERENCE DATA TYPE. 2 Primitive Data Types  The eight Java primitive data types are:  byte  short  int  long  float  double.
Game with US Beginner Tutorial. Welcome!! Who I am What is Processing? Basic Coding Input Methods Images Classes Arrays.
Variables and Operators
Recursion October 5, Reading Read pp in the text.
Data Types in Java Data is the information that a program has to work with. Data is of different types. The type of a piece of data tells Java what can.
Java Syntax Part I Comments Identifiers Primitive Data Types Assignment.
10-Jun-15 Just Enough Java. Variables A variable is a “box” that holds data Every variable has a name Examples: name, age, address, isMarried Variables.
©2004 Brooks/Cole Chapter 2 Variables, Values and Operations.
IAT 800 Foundations of Computational Art and Design Lecture 2.
IAT 800 Lab 1: Loops, Animation, and Simple User Interaction.
Boolean Expressions Conditional Statements & Expressions CSC 1401: Introduction to Programming with Java Lecture 4 – Part 2 Wanda M. Kunkle.
Lecture 4 Types & Expressions COMP1681 / SE15 Introduction to Programming.
ICM Week 2. Structure - statements and blocks of code Any single statement ends with semicolon ; When we want to bunch a few statements together we use.
Varriables CSC 171 FALL 2001 LECTURE 2. History The abacus.
Hello, world! Dissect HelloWorld.java Compile it Run it.
Review Blocks of code {.. A bunch of ‘statements’; } Structured programming Learning Processing: Slides by Don Smith 1.
Programming for Artists ART 315 Dr. J. R. Parker Art/Digital Media Lab Lec 10 Fall 2010.
 For Loops › for (variable set; condition; incremental or decrement){ // loop beginning › } // loop end  While loops › while (condition) { // beginning.
By Nicholas Policelli An Introduction to Java. Basic Program Structure public class ClassName { public static void main(String[] args) { program statements.
Java Data Types. Primitive Data Types Java has 8 primitive data types: – char: used to store a single character eg. G – boolean: used to store true or.
Continuous February 16, Test Review What expression represents the zip car eligibility rules of at least 18 years old and no incidents?
CSCI 3328 Object Oriented Programming in C# Chapter 5: C# Control Statement – Part II UTPA – Fall
Abstraction IS 101Y/CMSC 101 Computational Thinking and Design Tuesday, September 9, 2014 Carolyn Seaman Susan Martin University of Maryland, Baltimore.
C STRUCTURES. A FIRST C PROGRAM  #include  void main ( void )  { float height, width, area, wood_length ;  scanf ( "%f", &height ) ;  scanf ( "%f",
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 2: Variables & Data Types.
CIS 3.5 Lecture 2.2 More programming with "Processing"
BEGINNING PROGRAMMING.  Literally – giving instructions to a computer so that it does what you want  Practically – using a programming language (such.
Variables & Operators 1 Variables Store information needed by the program Must have a TYPE int - can only store a number without a fractional part float,
Variables Art &Technology, 3rd Semester Aalborg University Programming David Meredith
Lesson Two: Everything You Need to Know
C++ Basics. Compilation What does compilation do? g++ hello.cpp g++ -o hello.cpp hello.
Test 2 Review. General Info. All tests are comprehensive. You are still responsible for the material covered prior to the first exam. You will be tested.
Java Programming, Second Edition Chapter Two Using Data Within a Program.
School of Computer Science & Information Technology G6DICP - Lecture 4 Variables, data types & decision making.
Often being different. Control flow By default Java (and therefore Processing) executes lines of a program one after the other –Doesn’t matter what happened.
LCC 6310 Computation as an Expressive Medium Lecture 2.
Words. Characters and Strings Character –A single character inside of single quotes char letter = 'A' ; char digit = '0' ; – Strings Zero or more character.
Continuous. Flow of Control Programs can broadly be classified as being –Procedural Programs are executed once in the order specified by the code varied.
Java – Variables and Constants By: Dan Lunney. Declaring Variables All variables must be declared before they can be used A declaration takes the form:
 constant represented by a name, just like a variable, but whose value cannot be changed  The const keyword precedes the type, name, and initialization.
Review Random numbers mouseX, mouseY setup() & draw() frameRate(), loop(), noLoop() Mouse and Keyboard interaction Arcs, curves, bézier curves, custom.
Dr. Sajib Datta Jan 21,  Declare a variable ◦ int height; [note that no value is still assigned]  Assign a variable a value ◦ height =
1 Lecture # 2. * Introducing Programming with an Example * Identifiers, Variables, and Constants * Primitive Data Types * Byte, short, int, long, float,
Basic Data Types อ. ยืนยง กันทะเนตร คณะเทคโนโลยีสารสนเทศและการสื่อสาร มหาวิทยาลัยพะเยา Chapter 4.
Variables. Something to mention… void setup(){ size(200, 200); background(255); smooth(); } void draw() { stroke(0); strokeWeight(abs(mouseX-pmouseX));
CPSC 233 Tutorial January 21 st /22 nd, Linux Commands.
Chapter 2 Variables and Constants. Objectives Explain the different integer variable types used in C++. Declare, name, and initialize variables. Use character.
Midterm preview.
Topics introduced today (these topics would be covered in more detail in later classes) – Primitive Data types Variables Methods “for” loop “if-else” statement.
CIS3931 – Intro to JAVA Lecture Note Set 2 17-May-05.
Type Conversion, Constants, and the String Object
Computation as an Expressive Medium
Variables Store information needed by the program Must have a TYPE
Computers & Programming Languages
An Introduction to Java – Part I, language basics
Chapter 5, Conditionals Brief Notes
More programming with "Processing"
Java Programming Review 1
Variables & Datatypes CSE 120 Winter 2019
Exam1 Review CSE113 B.Ramamurthy 4/17/2019 B.Ramamurthy.
Primitive Types and Expressions
Chapter 4, Variables Brief Notes
Trigonometry & Random March 2, 2010.
IAT 800 Foundations of Computational Art and Design
Variables and Operators
Just Enough Java 17-May-19.
LCC 6310 Computation as an Expressive Medium
Variables and Constants
Presentation transcript:

Test Review

General Info. All tests will be comprehensive. You will be tested more on your understanding of code as opposed to your ability to write code. There will be multiple choice and true/false questions. Studying this review is not enough; you are responsible for all material covered in the lecture notes.

Test Review Which statement is not true of a variable declaration? Choose one answer. 1.The declaration must be made before the variable is used. 2.The declaration must give a name and a data type for the variable. 3.The declaration must give an initial value to the variable. 4.A variable cannot be used in a program unless it has been declared.

Test Review Examples of primitive data types are (Choose one answer.) 1.boolean, int, float, double, byte, and character 2.blean, int, float, byte, double, and char 3.boolean, int, floating, byte, double, and character 4.boolean, int, float, byte, double, and char

Test Review Write a statement that declares a variable to store a small number with a fractional (i.e., decimal) component. Write a statement that declares a variable to store a character.

Test Review What is the meaning of i++ ? What is the value of each of the following expressions: – * 5 / 2 –1 < 2 && 3 * 6 < 8 –(1 + 5) % 3

Test Review Write a boolean expression that represents the following English statement: The number 10 is greater than 1 but less than 20.

Test Review Will these programs print the same thing? int x = random(500); if (x <= 100) { rect(33, 33, 34, 34); } else if (x >= 300) { line(50, 0, 50, 100); } else if (x >= 400) { ellipse(50, 50, 36, 36); } int x = random(500); if (x <= 100) { rect(33, 33, 34, 34); } if (x >= 300) { line(50, 0, 50, 100); } if (x >= 400) { ellipse(50, 50, 36, 36); }

Test Review What will be printed by the following code segment? for (int i = 0; i<10; i=1) { print(i + " "); }

Test Review What is the test expression so that the following loop prints the line: int count = 0; while ( ___________ ) { print( count + " " ); count = count + 1; }

Test Review What must the initialization be so that the following fragment prints out the integers ? for ( _______; j < 0; j++ ) println( j );

Test Review What must be added so that the following code prints out the even integers ? for ( int j = 0; j <= 10; _______ ) println( j );

Test Review What would this program draw? size(400,400); smooth(); background(150); for(int x = 0; x < width; x += 40) { rect(x, 0, 10, 10); }

Test review Will the following program run? If not, why? void setup() { int x = 10, y = 10; size(400,400); smooth(); background(150); } void draw() { rect(x, y, 20, 20); }

Test Review How many functions are called in the program below? int x = 10, y = 10; void setup() { size(400,400); smooth(); background(150); } void draw() { rect(x, y, 20, 20); ellipse(x, y, 30, 30); }

Test Review How many functions are written in the program below? int x = 10, y = 10; void setup() { size(400,400); smooth(); background(150); } void draw() { rect(x, y, 20, 20); ellipse(x, y, 30, 30); }

Test Review What will this program draw? void setup() { size(400,400); smooth(); background(150); } void draw() { mysteryShape(); } void mysteryShape() { int w = 30, h = 20; rect(width/2, height/2, w, h); }