ENGR/CS 101 CS Session Lecture 4
Log into Windows/ACENET (reboot if in Linux) Start Microsoft Visual Studio 2012 Open DotChaser project Everyone have a GUI designed?
Lecture 4 ENGR/CS 101 Computer Science Session 1
ENGR/CS 101 CS Session Lecture 4 Log into Windows/ACENET (reboot if - - PowerPoint PPT Presentation
ENGR/CS 101 CS Session Lecture 4 Log into Windows/ACENET (reboot if in Linux) Start Microsoft Visual Studio 2012 Open DotChaser project Everyone have a GUI designed? Lecture 4 ENGR/CS 101 Computer Science Session 1 Outline
Lecture 4 ENGR/CS 101 Computer Science Session 1
C# programming language Implement update score
Event handlers Types, variables, expressions, assignment Accessing properties
Implement move dot
Methods Random number generator
Lecture 4 ENGR/CS 101 Computer Science Session 2
GUI designer Editor Compiler Linker Loader Debugger
Lecture 4 ENGR/CS 101 Computer Science Session 3
Lecture 4 ENGR/CS 101 Computer Science Session 4
Lecture 4 ENGR/CS 101 Computer Science Session 5
Lecture 4 ENGR/CS 101 Computer Science Session 6
Mouse events include: Click, DoubleClick,
Keyboard events include: KeyPress
Lecture 4 ENGR/CS 101 Computer Science Session 7
Lecture 4 ENGR/CS 101 Computer Science Session 8
Lecture 4 ENGR/CS 101 Computer Science Session 9
Event handler code for dot click goes here! Initialization code goes here! Application data goes here!
using statements that cause (pre-defined) method
namespace and class definition names based on the
Form1( ) constructor method. This code is executed
Lecture 4 ENGR/CS 101 Computer Science Session 10
When a user clicks on the dot, her score
An integer named score
Compute new numeric score Update user interface score
Lecture 4 ENGR/CS 101 Computer Science Session 11
Lecture 4 ENGR/CS 101 Computer Science Session 12
Must start with a letter Uses only letters, digits, and underscore (_) Cannot be a reserved word of the language
Specifies what kind of value may be stored.
Stored as bits (binary digits)
Lecture 4 ENGR/CS 101 Computer Science Session 13
Predefined by language: String, Array, List,… Written by programmer: Employee, Account,…
int for integers (e.g., 5, -25, 0) char for characters (e.g. 'A', 'b', '7', '%') string (e.g. "Hello!")
Lecture 4 ENGR/CS 101 Computer Science Session 14
Lecture 4 ENGR/CS 101 Computer Science Session 15
A literal. E.g., 12 or 'A' A variable. E.g., score A method call. (More on this later.) An expression of one or more literals, variables, or
Lecture 4 ENGR/CS 101 Computer Science Session 16
Lecture 4 ENGR/CS 101 Computer Science Session 17
Lecture 4 ENGR/CS 101 Computer Science Session 18
Lecture 4 ENGR/CS 101 Computer Science Session 19
Lecture 4 ENGR/CS 101 Computer Science Session 20
Lecture 4 ENGR/CS 101 Computer Science Session 21
Lecture 4 ENGR/CS 101 Computer Science Session 22
When the dot is clicked When the time period is up
Lecture 4 ENGR/CS 101 Computer Science Session 23
Lecture 4 ENGR/CS 101 Computer Science Session 24
x y z
. . .
In the case of moving a dot, the caller doesn't
These were given previously for moving the dot
Lecture 4 ENGR/CS 101 Computer Science Session 25
Lecture 4 ENGR/CS 101 Computer Science Session 26
Lecture 4 ENGR/CS 101 Computer Science Session 27
Lecture 4 ENGR/CS 101 Computer Science Session 28
Lecture 4 ENGR/CS 101 Computer Science Session 29
Lecture 4 ENGR/CS 101 Computer Science Session 30