Announcements: Questions: Names on the board? Why?

Slides:



Advertisements
Similar presentations
Computer Programming w/ Eng. Applications
Advertisements

 Communication:  Provide context, e.g., s …  TA Office hour for next Tuesday: CANCELLED  My name is: ??  Show  Scores on-line, Quiz-1 results.
Introduction to Unix – CS 21 Lecture 11. Lecture Overview Shell Programming Variable Discussion Command line parameters Arithmetic Discussion Control.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Changing Control.
Lecture 2 Introduction to C Programming
10 November JavaScript. Presentation Hints What do YOU think makes a good presentation Some of my suggestions Don’t write full sentences on slides Talk,
CSE 1301 Lecture 2 Data Types Figures from Lewis, “C# Software Solutions”, Addison Wesley Richard Gesick.
Welcome – You’ve found CSE120 OR Computer Science Principles OR UWIT…  Announcements are usually listed here and displayed before the start of class 
Summary of what we learned yesterday Basics of C++ Format of a program Syntax of literals, keywords, symbols, variables Simple data types and arithmetic.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Assignment 6.
Beginning Fortran Fortran (77) Advanced 29 October 2009 *Black text on white background provided for easy printing.
Perl Tutorial. Why PERL ??? Practical extraction and report language Similar to shell script but lot easier and more powerful Easy availablity All details.
Python Let’s get started!.
BIT 115: Introduction To Programming Professor: Dr. Baba Kofi Weusijana (say Doc-tor Way-oo-see-jah-nah, Doc-tor, or Bah-bah)
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Functional Abstraction Reduces Complexity.
1 Project 2: Using Variables and Expressions. 222 Project 2 Overview For this project you will work with three programs Circle Paint Ideal_Weight What.
Functions in C++ Top Down Design with Functions. Top-down Design Big picture first broken down into smaller pieces.
Lawrence Snyder University of Washington, Seattle © Lawrence Snyder 2004 Making an example of Pacman.
Quiz 1 A sample quiz 1 is linked to the grading page on the course web site. Everything up to and including this Friday’s lecture except that conditionals.
JavaScript: Conditionals contd.
Chapter 10 Programming Fundamentals with JavaScript
Winter 2009 Tutorial #6 Arrays Part 2, Structures, Debugger
Topic: Python’s building blocks -> Variables, Values, and Types
User-Written Functions
CSE 220 – C Programming C Fundamentals.
Unit C: Expressions Lesson 03: Mathematical Properties with Variables
Python Let’s get started!.
Introduction to Python
Presented By S.Yamuna AP/IT
Announcement Tomorrow’s office hr: CANCELLED! Show work!!
Cookies BIS1523 – Lecture 23.
To do … Web Exercise: Quiz-3, HW#2 Score: update
Chapter 10 Programming Fundamentals with JavaScript
Chapter 2 - Introduction to C Programming
Building Web Applications
Chapter 2 - Introduction to C Programming
First Python Program Professor Hugh C. Lauer CS-1004 — Introduction to Programming for Non-Majors (Slides include materials from Python Programming: An.
CSE 8A Lecture 6 Reading for next class:
Alice Variables Pepper.
Course websites CS201 page link at my website: Lecture slides
Announcements Mid-Term Exam!! Quiz 5 Again + Quiz 6 Exercise 5
Light Bot Solutions: an analysis
Light Bot Solutions: an analysis
Announcement Function ppt: download again
Statements and expressions - java
Announcements How’s it going? My internet/power supply?
Digital Thinking: Animation, Video Games, and the Social Web
Testing and Repetition
Announcements: Reading materials are posted on Discussion Board.
Class 2.
Announcements Final Course Survey Thursday: Quiz-11 Today:
Variables, Assignments Testing + Iteration
Summary of what we learned yesterday
Javascript Chapter 19 and 20 5/3/2019.
Unit 3: Variables in Java
Announcements How to save your work? Quiz solution 5/5/2019
Subject:Object oriented programming
Basic Processing … Drawing pictures … It’s not art, it’s fun
Variables in C Topics Naming Variables Declaring Variables
Digital Thinking: Animation, Video Games, and the Social Web
CS31 Discussion 1D Fall18: week 2
CSCE 206 Lab Structured Programming in C
Introduction to C Programming
Announcements Survey feedback: summary Quiz: HW 7:
CS 580u Programming Systems and Tools
CMPT 120 Lecture 4 – Unit 1 – Chatbots
Zorah Fung University of Washington, Winter 2016
Today: to list: Syllabus change: Grade on-line
Announcements Jack group member by Thursday!! Quiz-8? HW10
Presentation transcript:

Announcements: Questions: Names on the board? Why? Exercise 3, and HW4: Submission, WHAT?! .sln files vs .cs files, where are the files? Quiz 2: My mistake: Comment vs. Command: What I did? Auto grading vs. grading by hand Anything else? 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010 Larry Snyder, CSE)

HW4: Answer the Questions vs. Extra Credit Points of the question may be missed!! 4a: How to comments 4b: Explain code vs. Describe effect 4c: Pattern recognition and blocks 4d: Parameters Extra credit: ENCOURAGED!! Show work Quiz 2: Go over the questions 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010 Larry Snyder, CSE)

A Word about: Note taking!! Readings: Check out GoPost: READ Quiz-3: to be completed between Wed and Sat Wed Survey: Thank you Do: In-class, Hands-on, programming Don’t: Less lectures, assumption of basic knowledge Writing on the board, time for answer A Word about: Note taking!! DO IT!! 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010 Larry Snyder, CSE)

Questions? Wait for 30 seconds. Shut up and look at the clock 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010 Larry Snyder, CSE)

Parameters On our way to Pong! Kelvin Sung University of Washington, Bothell (* Use/Modification with permission based on Larry Snyder’s CSE120 from Winter 2011) © Lawrence Snyder 2004

Review InitializeWorld vs. UpdateWorld Remember to: When to put code where? “{}”: What does it mean to be “inside” a function? Remember to: Always COMPILE and RUN! Check on-line FAQ! Remember Intellisense? Good: tells you what are the available options Bad: You cannot do anything other than the provided options! 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010 Larry Snyder, CSE)

Being Successful with Computers Two habits of computer people … they would be good ones for everyone #1 When things go wrong, figure out what’s wrong yourself … ask when all else fails Why do they behave like this? Stuff goes wrong all the time … you think you have problems with computers; try being an expert! #2 Persistence … stay with it until you get it; everyone in class showed persistence with Lightbot 2.0 … we will need that a lot more Why are they persistent? Because many things just take effort … and when you get it, it’s satisfying! 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010 Larry Snyder, CSE)

Vocabulary Parameters and Arguments New Term: Parameters are the names for the positions; arguments are their values 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010 Larry Snyder, CSE)

Parameters to circle construction What does each do and why? 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010 Larry Snyder, CSE)

Download the source code (refer to course web-site) Work with the person beside you Investigate and Take your own notes! Do the following: (10 minutes) 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010 Larry Snyder, CSE)

Re-Analyze the code: How many ways can one create a circle? Can you tell which circle is which? What are the parameters to circle creation? What do the parameters mean? How do we know what value is for which parameter? What if we don’t give parameters values? How to find out more? Try it! Link to on-line manual (Our course web-site, under the Programming header). 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010 Larry Snyder, CSE)

Trying things out!: Each person: 20 minutes Can you create your own Circles? Location: Vector2(100, 100), Radius: 18f, No Texture Location: Vector2(300, 500), Radius: 3f, Texture: airplane How about a rectangle? What are the parameters for constructing a rectangle? How many different ways can you create a rectangle? What arguments should you pass to the parameters of the rectangle construction? 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010 Larry Snyder, CSE)

How to create this? String: everything in between “ and “ Center: (30, 300) Width: 15 Height: 100 Color: Brown Center: (770, 300) Width: 15 Height: 100 Color: Pink String: everything in between “ and “ “\n” inside a sting! 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010 Larry Snyder, CSE)

Speed of ball as parameter! How can we move the ball “automatically”? Discuss with person beside you 10 minutes 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010 Larry Snyder, CSE)

Questions? Exercise-4 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010 Larry Snyder, CSE)

Something we have done! Variables and Declarations Assignments Expressions * You have been doing this!! 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010 Larry Snyder, CSE)

Variables … Facts about variables are … Rules about variables are … Variables “contain” their values, and they can be changed using assignment Variables have a data type such as int, float, XNACS1Circle, etc. which is the data they contain Rules about variables are … Variables can be any string of letters, numbers or underscores (_) starting with a letter; case-sensitive Variables must be declared; declarations at the top of the program or at the start of a function Variables can be initialized in a declaration 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010 Larry Snyder, CSE)

Variables, the Picture Facts Rules “Contain their value”: “Assign to change: grade_point = 3.9;” “Variables have data type”: Rules “Any string”: Pick, MEANINGFUL, varz, theyRuseful_4_U_despite_their_length “Declare vars”: int score; float gpa; Color purple; “Initializing is OK”: int score=0; float gpa=4.0f; Color purple=Color.Purple; grade_point: 3.8 3.9 grade_point: 3.8 myCircle: Center, Radius, Label 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010 Larry Snyder, CSE)

Assignments Facts about assignment: Rules about assignment: Its form is always <variable> = <expression> Information moves from right to left The <expression> is computed first, then the variable is changed, so x=x+1 is sensible Remember the “+=“? To exchange values in two variables takes 3 stmts Rules about assignment: All assignment statements end with a semicolon 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010 Larry Snyder, CSE)

Assignments, The Picture Facts “Form”: grade_point=3.9; yellow=new color(255,255,0); 3.9 = grade_point is ILLEGAL “Info moves right to left”: x = 4.0; “Compute <expression> first: x = x + 1; “Exchanging values of x, y takes 3 statements”: temp = x; x = y; y = temp; 5.0  4.0 + 1 temp: 1.0 x: 5.0 y: 6.0 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010 Larry Snyder, CSE)

Assignments, The Picture Facts “Form”: grade_point=3.9; yellow=new color(255,255,0); 3.9 = grade_point is ILLEGAL “Info moves right to left”: x = 4.0; “Compute <expression> first: x = x + 1; “Exchanging values of x, y takes 3 statements”: temp = x; x = y; y = temp; 5.0  4.0 + 1 temp: 5.0 x: 5.0 y: 6.0 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010 Larry Snyder, CSE)

Assignments, The Picture Facts “Form”: grade_point=3.9; yellow=new color(255,255,0); 3.9 = grade_point is ILLEGAL “Info moves right to left”: x = 4.0; “Compute <expression> first: x = x + 1; “Exchanging values of x, y takes 3 statements”: temp = x; x = y; y = temp; 5.0  4.0 + 1 temp: 5.0 x: 6.0 y: 6.0 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010 Larry Snyder, CSE)

Assignments, The Picture Facts “Form”: grade_point=3.9; yellow=new color(255,255,0); 3.9 = grade_point is ILLEGAL “Info moves right to left”: x = 4.0; “Compute <expression> first: x = x + 1; “Exchanging values of x, y takes 3 statements”: temp = x; x = y; y = temp; 5.0  4.0 + 1 temp: 5.0 x: 6.0 y: 5.0 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010 Larry Snyder, CSE)

Expressions Facts about expressions Rules about expressions Expressions are formulas using: + - * / % “+=“ Operators can only be used with certain data types and their result is a certain data type Putting in parentheses is OK, and it’s smart Rules about expressions Expressions can usually go where variables can go 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010 Larry Snyder, CSE)

Expressions, the Picture Facts Expressions are formulas: a+b points*wgt “Parentheses are good”: (a * b) + c is the same as a*b+c, but easier to read Rules “Expressions replace vars” Radius = r 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010 Larry Snyder, CSE)

How to Move the circle? 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010 Larry Snyder, CSE)

Parameters in general In a String Variables as parameters for our entire program! How do I move my circle “automatically”? 5/16/2019 Kelvin Sung (Use/Modify with permission from © 2010 Larry Snyder, CSE)