Computer Programming 12 Mr. Jean May 8 th, 2013. The plan: Video clip of the day Upcoming Assessment Bot.java.

Slides:



Advertisements
Similar presentations
1a)I can identify the hypothesis and the conclusion of a conditional 1b)I can determine if a conditional is true or false 1c)I can write the converse of.
Advertisements

Switch code for Lab 4.2 switch (input) { /* input is a variable that we will test. */ case 'M': printf("The prefix is equal to 1E6.\n"); break; case 'k':
Programming In C++ Spring Semester 2013 Lecture 3 Programming In C++, Lecture 3 By Umer Rana.
1 JavaScript: Control Structures II. 2 whileCounter.html 1 2
CIS101 Introduction to Computing Week 12. Agenda Your questions Solutions to practice text Final HTML/JavaScript Project Copy and paste assignment JavaScript:
CMPUT 101 Lab # 5 October 22, :00 – 17:00.
Computer Science 1620 Loops.
1 9/28/07CS150 Introduction to Computer Science 1 Loops section 5.2, 5.4, 5.7.
© Copyright 1992–2005 by Deitel & Associates, Inc. and Pearson Education Inc. All Rights Reserved. Tutorial 8 - Interest Calculator Application: Introducing.
Loops Repetition Statements. Repetition statements allow us to execute a statement multiple times Often they are referred to as loops Like conditional.
© 2004 Pearson Addison-Wesley. All rights reserved5-1 Iterations/ Loops The while Statement Other Repetition Statements.
Week 7 - Programming II Today – more features: – Loop control – Extending if/else – Nesting of loops Debugging tools Textbook chapter 7, pages
Variables and Arithmetic. From last class More drawing functions: strokeWeight(n); // higher the n value broader the stroke fill(k) ; // single parameter.
Computer Science 12 Mr. Jean May 2 nd, The plan: Video clip of the day Review of common errors in programs 2D Arrays.
Module 3 Fraser High School. Module 3 – Loops and Booleans import statements - random use the random.randint() function use while loop write conditional.
Vectors and Matrices In MATLAB a vector can be defined as row vector or as a column vector. A vector of length n can be visualized as matrix of size 1xn.
CS 101: Introduction to computer programming and utilization Abhiram Ranade.
Semester Review. As we have discussed, Friday we will have in class time for you to work on a program, this program will come with instructions and you.
Getting Started with MATLAB 1. Fundamentals of MATLAB 2. Different Windows of MATLAB 1.
PHP Logic. Review: Variables Variables: a symbol or name that stands for a value – Data types ( Similar to C++ or Java): Int, Float, Boolean, String,
Computer Programming 12 Mr. Jean April 24, The plan: Video clip of the day Upcoming Quiz Sample arrays Using arrays More about arrays.
Loops & Graphics IP 10 Mr. Mellesmoen Recall Earlier we wrote a program listing numbers from 1 – 24 i=1 start: TextWindow.WriteLine(i) i=i+1 If.
Check 12-1 HW. Course Graphing Functions 6 th Grade Math HOMEWORK Page 608 #7-20.
read and learn from example loop programs develop modular program
Trigonometric Identities An identity in math is : - an unconditional statement of equality - true for all values of the variable(s) for which the equation.
Iteration Hussein Suleman UCT Dept of Computer Science CS115 ~ 2004.
CS 115 QUIZ # 2 INFORMATION 1. When TUESDAY 11/10 Worth: 8 points 2.
© 2006 Pearson Education 1 Obj: to use assignment operators HW: Prelab Exercises 2 Quiz 3.1 – 3.4 in two class days  Do Now: 1.Read p.144 – 145 (3.4 “more.
Hosted by Mr. Bagunolo Function Area Formula Circle, Rectangle, Square What if?
 In computer programming, a loop is a sequence of instruction s that is continually repeated until a certain condition is reached.  PHP Loops :  In.
1 Installing Java on Your PC. Installing Java To develop Java programs on your PC: Install JDK (Java Development Kit) Add the directory where JDK was.
1 Project 7: Looping. Project 7 For this project you will produce two Java programs. The requirements for each program will be described separately on.
1 SIC / CoC / Georgia Tech MAGIC Lab Rossignac Processing  Install Processing  Learn how to edit, run, save, export,
1 Karel – Chapter 6 Instructions That Repeat Note: Original slides provided by and modified for Mr. Smith’s AP Computer Science.
Midterm Review Tami Meredith. Primitive Data Types byte, short, int, long Values without a decimal point,..., -1, 0, 1, 2,... float, double Values with.
Computer Programming 12 Mr. Jean March 5 th, 2014.
1 Project 5: Leap Years. 222 Leap Years Write a program that reads an integer value from the user representing a year and determines if the year is a.
1 Project 4: Computing Distance. 222 Computing Distance Write a program to compute the distance between two points. Recall that the distance between the.
Estimating the Area of a Circle Math 8 Stewart COPY SLIDES THAT HAVE A PENCIL.
Lecture 3.1: Operator Precedence and Eclipse Tutorial Michael Hsu CSULA.
IST 210: PHP Logic IST 210: Organization of Data IST2101.
UCT Department of Computer Science Computer Science 1015F Iteration
Follow up from lab See Magic8Ball.java Issues that you ran into.
Introduction to Programming
CprE 185: Intro to Problem Solving (using C)
Chapter 5 Loops Liang, Introduction to Java Programming, Tenth Edition, (c) 2015 Pearson Education, Inc. All rights reserved.
Week of 12/12/16 Test Review.
Dynamics 15 – Inclined Planes II Mr. Jean
Introduction to Programming
Announcements Quiz 1 Posted on blackboard
Primitive Data, Variables, Loops (Maybe)
Adding Assignments and Learning Units to Your TSS Course
Programming Lab 2 Robot Basic Lessons 1 and 2
Introduction to Programming
Looping and Repetition
Outline Altering flow of control Boolean expressions
Introduction to Programming
Unit 3: Lesson 9-Looping and Random Numbers
Variables and Arithmetic
Introduction to Programming
Unit 1 Test 1 Redo Friday at 8am here or Friday 4th BLOCK in Math Lab
Feedback Pace Different ideas for delivery Debugging strategies
More About Objects and Methods
Vectors and Matrices In MATLAB a vector can be defined as row vector or as a column vector. A vector of length n can be visualized as matrix of size 1xn.
CSCI N207 Data Analysis Using Spreadsheet
Seating “chart” Front - Screen rows Back DOOR.
Introduction to Programming
CS 1054 Final Exam Coverage Final exam will cover Chapters 1-8, 10-11
Looping and Repetition
Presentation transcript:

Computer Programming 12 Mr. Jean May 8 th, 2013

The plan: Video clip of the day Upcoming Assessment Bot.java

Java Quiz #2: Questions about –Types of variables Int, double, spring –Basic Math operations + - * / % –Order of operations in Java –True Tables

Quiz #2 - Format Multiple Choice –15 questions Date: May 13 th, 2013

Loops refresher: Recall the usage of for loops. We define a for loop with three parts: the initializer, the tester and the increment. Here is an example of a for loop that would run 10 times: for (int i = 1; i <= 10; i++) This loop will begin with i equal to 1 and will continue until i equals 11. This means that it will run when i equals 1, 2, 3, 4, 5, 6, 7, 8, 9 and 10.

The Bot class: We will now use loops to make the Bot draw. As stated in section 3.4 of the textbook, the Bot class is a simulation of a drawing robot. You can give this robot commands and he will perform them on the screen for you.

Possible Bot Commands:

Using the Bot Class: You can use the Bot class in your program as long as you have the file Bot.java in the same directory as your program. You can find Bot.java on the G: drive in the course pass-out folder. Copy it to the directory of your program’s java file. There’s no need for an import statement.

This program loops four times. On each iteration of the loop, the robot draws a line of length 100 and then rotates 90 degrees. You can easily see how this would draw the four sides of a square.

To do: Complete Java Assignment #3 Work on Drawing LAB which is posted in our Moodle account.