Introduction. CSC 440: Software Engineering Slide #1

Size: px
Start display at page:

Download "Introduction. CSC 440: Software Engineering Slide #1"

Transcription

1 Introduction CSC 440: Software Engineering Slide #1

2 Topics 1. Course Goals 2. Programming: Small vs. Large 3. Challenges of Large Programs 4. Software Processes and Methods 5. Teams and Roles 6. Rails overview 7. Roll call and Ruby install 8. Ruby Basics 9. Assignment #1 CSC 440: Software Engineering Slide #2

3 Course Goals 1. Learn the concepts of software engineering through applying them to a semester-long team project. 2. Understand how programming in the large differs from writing small programs in previous classes. 3. Create a web application using the full stack Ruby on Rails framework as part of a small team. CSC 440: Software Engineering Slide #3

4 Programming: small vs. large CSC 440: Software Engineering Slide #4

5 Challenge of Large Programs With any nontrivial software application, the major software engineering challenge is dealing with Complexity and Change CSC 440: Software Engineering Slide #5

6 Complexity Size A large school assignment: 5-10 Java classes A compiler or interpreter: ~150 classes and interfaces A major enterprise application: hundreds of classes and interfaces. Number of Developers An individual school assignment: 1, up to 4 A medium-size project: 5-12 A major enterprise application: dozens. CSC 440: Software Engineering Slide #6

7 Complexity Technology Frameworks: Ruby on Rails, Spring, etc. Tools: Git, Heroku, Gantt charts,... Other systems: database, payment, etc. Project artifacts (written and oral) Requirements specifications, software design, design reviews, project plans, test plans, project schedules, code reviews, demos, CSC 440: Software Engineering Slide #7

8 Changes Requirements Customers don t know what they want. Customers change their minds. Marketing decides new features are necessary. Schedule We need it done sooner! Resources Technology and tools Personnel and money CSC 440: Software Engineering Slide #8

9 Participants in Software Development CUSTOMER Sponsors system development $$$, needs DEVELOPER Uses system USER Contractual obligation Needs Builds system Software system CSC 440: Software Engineering Slide #9

10 Software Process A software process is a set of activities that leads to the production of a software product. Ian Sommerville, Software Engineering, 7 th ed. A software process [is] a framework for the tasks that are required to build high-quality software. [It] defines the approach that is taken as software is engineered. Roger Pressman, Software Engineering: A Practitioner s Approach, 6 th ed. 10

11 Method A method is a reusable technique or algorithm for solving a specific problem. This is the common definition of method, not to be confused with a method (operation) of a class in the object-oriented sense. Example methods Object-oriented design techniques Source control Online bug tracking 11

12 Methodology A methodology is a collection of methods for solving a class of problems. Bernd Bruegge and Allen Dutoit, Object-Oriented Software Engineering Using UML, Patterns, and Java, 3 rd ed. [A methodology] specifies how and when each method should be used. ibid 12

13 Software Process, cont d A software process is the application of a methodology in order to develop software. Every methodology has: Beliefs and assumptions Prescribed rules of behavior Criteria to determine what s good and what s bad Sacred documents that describe the methodology and gurus who promote it Believers and nonbelievers. Methodology = religion? 13

14 Why do we need a process? People are more important than any process. Good people with a good process will outperform good people with no process every time. -- Grady Booch CSC 440: Software Engineering Slide #14

15 Software Engineering is team-based processes that manage complexity and change in order to successfully develop software products. Team-based Processes Manage complexity Manage change. } Successful software products! 15

16 Team Member Roles A role defines the set of tasks that a team member is expected to complete. A task can be technical or managerial, programming related or not. When you assign a role to a team member, you make that team member responsible for completing the role s tasks. CSC 440: Software Engineering Slide #16

17 Team Member Role Examples Project lead Software architect User interface (UI) designer HTML programmer Ruby programmer Quality assurance (tester) Database architect Database administrator Documenter etc. CSC 440: Software Engineering Slide #17

18 Team Member Roles Not all roles need to be filled in each team. Each team member must have at least one role. A team member can have more than one role simultaneously during the project. A role can be filled by more than one team member. CSC 440: Software Engineering Slide #18

19 Project Teams Choose your team members wisely! Be sure you ll be able to meet and communicate with each other and work together well. No moving from team to team. Each team me by Monday, August 29 with: Subject: CSC 440 team Team Name Message body must include: Team name. A list of team members with addresses. CSC 440: Software Engineering Slide #19

20 Team Activities Generate written artifacts. Requirements specification Design document Project plan and schedule Test plan Make oral presentations Inception (requirement focus) Iteration 1 (design focus + demo) Iteration 2 (implementation focus + demo) Iteration 3 (quality focus + demo) Class attendance and participation are especially important during oral presentations! CSC 440: Software Engineering Slide #20

21 Individual Responsibilities You are personally responsible for participating and contributing to your team s work, and for understanding each part of the work for every assignment whether or not you worked on that part. CSC 440: Software Engineering Slide #21

22 Postmortem Assessment Report At the end of the semester, each student will individually turn in a short (one page) report: A brief description of what you learned in the course. An assessment of your personal accomplishments for your project team. An assessment of each of your project team members. CSC 440: Software Engineering Slide #22

23 Ruby and Rails Ruby A dynamic, object-oriented programming language Invented in 1993 by Yukihiro Matz Matsumoto Combines Perl, Smalltalk, Eiffel, Ada, and Lisp A programmer s best friend Rails Open source, full stack web framework Runs on Ruby Programmer happiness and productivity Convention over configuration CSC 440: Software Engineering Slide #23

24 Ruby on Rails Design, build, and deploy a complete web application with Ruby on Rails framework. Front end: Dynamically generated web pages Middleware: Server-side business logic Back end: Relational database repository CSC 440: Software Engineering Slide #24

25 Ruby on Rails Features Model-view-controller (MVC) architecture Representational State Transfer (REST) Object-relational mapping (ORM) Active record design pattern CSC 440: Software Engineering Slide #25

26 High-Level Architecture of a Web Application Client computer Server computer Internet connection Web browser Web server Database server CSC 440: Software Engineering Slide #26

27 Static Web Pages Client Server HTTP request Browser Web server HTML file HTTP response CSC 440: Software Engineering Slide #27

28 Dynamic Web Pages Client Server HTTP request Browser Web server Web application HTTP response Web application dynamically generates HTML for web page based on browser request. Browser cannot distinguish static and dynamic pages. CSC 440: Software Engineering Slide #28

29 Architecture of a Rails App CSC 440: Software Engineering Slide #29

30 Architecture of a Rails App Slide #30

31 Roll Call and Ruby Install Roll call If you haven t installed ruby yet, see for how to do so on your operating system. CSC 440: Software Engineering Slide #31

32 Interactive Ruby Interpreter (IRB) Uses a Read-Eval-Print-Loop (REPL) Reads what you type in Evaluates it Prints the result Loops back to read again Every Ruby method returns something. Even if it s just nil. CSC 440: Software Engineering Slide #32

33 Ruby Variables Don t need to be declared or typed in advance. Dynamic typing Types associated with values, not variables. Example: irb(main):045:0> my_var = 14 => 14 irb(main):046:0> my_var = "Buddy" => "Buddy" Naming convention: snake case All lowercase with underscores between words. CSC 440: Software Engineering Slide #33

34 Ruby Data Types: Numbers Standard arithmetic operators: + - * / % Integer division by default, unless one of the operands is made floating-point with a decimal point. % is the modulus (remainder) operator You can apply methods to numbers. Example: irb(main):015:0> 1.odd? => true Ruby naming conventions for methods: Boolean methods end with a question mark. Methods that modify their operands or anything else dangerous end with an exclamation point. CSC 440: Software Engineering Slide #34

35 Ruby Data Types: Strings Single- or double-quoted. Double-quoted strings enable string interpolation. \n for new line and \t for tab Enclose an expression with #{ and } irb(main):047:0> x = 12 => 12 irb(main):048:0> "It's exactly #{x} for\ntoday." => "It's exactly 12 for\ntoday." irb(main):049:0> puts "It's exactly #{x} for\ntoday." It's exactly 12 for today. => nil CSC 440: Software Engineering Slide #35

36 Ruby Data Types: Strings, cont d String concatenation with the + operator. Example: String multiplication with the * operator. Example: Methods length and empty? Examples: irb(main):050:0> "Hello" + ", " + "world" => "Hello, world" irb(main):051:0> "good-bye "*3 => "good-bye good-bye good-bye " irb(main):052:0> "hello".length => 5 irb(main):053:0> "hello".empty? => false CSC 440: Software Engineering Slide #36

37 Ruby Data Types: Arrays Create by listing objects in square brackets. Example: Array elements can be any type, including array. Index elements using the [] method. Index starting at zero. Examples: list[0] list[i] Get nil if you access an element not in the array. The [] method can specify a range. Example: irb(main):011:0> list=[1, 2, 3, 4, 5, 6] => [1, 2, 3, 4, 5, 6] irb(main):012:0> list[2, 4] => [3, 4, 5, 6] CSC 440: Software Engineering Slide #37

38 Ruby Data Types: Arrays, cont d Concatenate arrays with the + operator. Returns a new array without modifying the operands. Example: Append to an array with the << operator. Modifies the array. Example: irb(main):013:0> list + ["foo", "bar"] => [1, 2, 3, 4, 5, 6, "foo", "bar"] irb(main):014:0> list << 'x' => [1, 2, 3, 4, 5, 6, "x"] irb(main):016:0> list[7] => nil irb(main):018:0> list[10]='z' => "z" irb(main):019:0> list => [1, 2, 3, 4, 5, 6, "x", nil, nil, nil, "z"]

39 Ruby Data Types: Hashes A built-in hash table type. Enclose hash values with { and }. Key-value pairs. A key can be any type, but typically a symbol. Use the [] method with a key value to access the corresponding value. Example: => is a hash rocket irb(main):025:0> dude = {:name => "Matz",:age => 50} => {:name=>"matz", :age=>50} irb(main):026:0> dude[:name] => "Matz" irb(main):027:0> dude[:age] => 50 CSC 440: Software Engineering

40 Ruby Data Types: Hashes, cont d Shortcut syntax for symbol keys. Example: irb(main):030:0> dude = { :name => "Matz", :age => 50 } => {:name=>"matz", :age=>50} irb(main):031:0> dudette = {name: "Mary",age: "won't tell"} => {:name=>"mary", :age=>"won't tell"} Methods keys and values. Examples: irb(main):034:0> dudette.keys => [:name, :age] irb(main):035:0> dude.values => ["Matz", 50] CSC 440: Software Engineering Slide #40

41 Ruby Data Types: Booleans Values true or false. Operators equal to == and not equal to!= Operators and && and or Short circuit operators && doesn t evaluate the second operand if the first operand is false. doesn t evaluate the second operand if the first operand is true. Only nil and false are considered false. Every other value is considered true, even empty strings. CSC 440: Software Engineering Slide #41

42 Ruby Data Types: Booleans, cont d Conditional assignment operator = Initialize a variable s value only if it is currently nil. Examples irb(main):038:0> x = nil => nil irb(main):039:0> y = 12 => 12 irb(main):040:0> x = 7 => 7 irb(main):041:0> y = 0 => 12 CSC 440: Software Engineering Slide #42

43 Ruby Constants The name of a constant must begin with a capital letter. By convention, the entire name is in caps. You shouldn t change the value of a constant. But Ruby will allow it after issuing a warning. Example: irb(main):054:0> PI = => irb(main):055:0> PI = 3 (irb):55: warning: already initialized constant PI (irb):54: warning: previous definition of PI was here => 3 irb(main):056:0> PI => 3 CSC 440: Software Engineering Slide #43

44 Ruby Conditional Statements if elsif... else... end Example: irb(main):060:0> age = 21 => 21 irb(main):061:0> if age < 13 irb(main):062:1> puts "Child" irb(main):063:1> elsif age < 18 irb(main):064:1> puts "Teen" irb(main):065:1> else irb(main):066:1> puts "Adult" irb(main):067:1> end Adult => nil CSC 440: Software Engineering Slide #44

45 Ruby Conditional Statements, cont d unless end Example: irb(main):068:0> name = "Tony" => "Tony" irb(main):069:0> if!name.empty? irb(main):070:1> puts name irb(main):071:1> end Tony => nil irb(main):072:0> unless name.empty? irb(main):073:1> puts name irb(main):074:1> end Tony => nil CSC 440: Software Engineering Slide #45

46 Ruby Conditional Statements, cont d One-line expressions Examples: irb(main):075:0> puts name if!name.empty? Tony => nil irb(main):076:0> puts name unless name.empty? Tony => nil CSC 440: Software Engineering Slide #46

47 Ruby Iteration Use the each method on a list or hash to iterate over the elements. Example: irb(main):094:0> countdown = [3, 2, 1, "Blastoff!"] => [3, 2, 1, "Blastoff!"] irb(main):095:0> countdown.each do elmt irb(main):096:1* puts elmt irb(main):097:1> end Blastoff! => [3, 2, 1, "Blastoff!"] CSC 440: Software Engineering Slide #47

48 Ruby Iteration, cont d Use { } instead of do end for one liners. irb(main):098:0> countdown.each { elmt puts elmt } Blastoff! => [3, 2, 1, "Blastoff!"] CSC 440: Software Engineering Slide #48

49 Ruby Iteration, cont d Use each_with_index if you need array index. irb(main):098:0> c=countdown irb(main):099:0> c.each_with_index do elmt, index irb(main):100:1* puts "Item #{index} is #{elmt}" irb(main):101:1> end Item 0 is 3 Item 1 is 2 Item 2 is 1 Item 3 is Blastoff! => [3, 2, 1, "Blastoff!"] CSC 440: Software Engineering Slide #49

50 Ruby Iteration, cont d Iterate over a hash. Example: irb(main):090:0> dude.each { key, value irb(main):091:1* puts "The #{key} is #{value}." irb(main):092:1> } The name is Matz. The age is 50. => {:name=>"matz", :age=>50} CSC 440: Software Engineering Slide #50

51 Ruby Iteration, cont d Iterate over a hash in order of hash keys. Example: irb(main):039:0> dude.keys.sort.each do key irb(main):040:1* puts "Key #{key} has value #{dude[key]}" irb(main):041:1> end Key age has value 50 Key name has value Matz => [:age, :name] CSC 440: Software Engineering Slide #51

52 Ruby Methods Define your own methods with def. Example: irb(main):112:0> def say_hello(name = "world") irb(main):113:1> puts "Hello, #{name}!" irb(main):114:1> end => :say_hello Use snake case for method names. Formal parameters can have default values. A method definition returns the method name. CSC 440: Software Engineering Slide #52

53 Ruby Methods, cont d irb(main):112:0> def say_hello(name = "world") irb(main):113:1> puts "Hello, #{name}!" irb(main):114:1> end puts returns nil => :say_hello A method returns the value of the last statement that it executed. Examples: Parentheses are optional around method arguments. irb(main):119:0> say_hello Hello, world! => nil irb(main):120:0> say_hello("ron") Hello, Ron! => nil irb(main):121:0> say_hello "Mary" Hello, Mary! => nil 53

54 Ruby Methods, cont d You can raise an exception. irb(main):122:0> def factorial(n) irb(main):123:1> if n < 1 irb(main):124:2> raise "Argument #{n} must be > 0" irb(main):125:2> elsif n == 1 irb(main):126:2> 1 irb(main):127:2> else irb(main):128:2* n*factorial(n-1) irb(main):129:2> end irb(main):130:1> end => :factorial irb(main):131:0> factorial 5 => 120 irb(main):132:0> factorial 0 RuntimeError: Argument 0 must be > 0 from (irb):124:in `factorial' from (irb):132 from /usr/local/bin/irb:11:in `<main>' CSC 440: Software Engineering Slide #54

55 Ruby Classes A class name must be capitalized. A class definition can include an initialize method as the constructor. Private instance variables start CSC 440: Software Engineering Slide #55

56 Ruby Classes, cont d irb(main):133:0> class Person irb(main):134:1> def initialize(name) = name irb(main):136:2> end irb(main):137:1> irb(main):138:1* def greet irb(main):139:2> puts "Hi, I'm #{@name}." irb(main):140:2> end irb(main):141:1> end => :greet irb(main):142:0> guy = Person.new("Ron") => irb(main):143:0> guy.greet Hi, I'm Ron. => nil CSC 440: Software Engineering Slide #56

57 Getter and Setter Methods Instance variables are private. irb(main):146:0> guy.name NoMethodError: undefined method `name' for from (irb):146 from /usr/local/bin/irb:11:in `<main> Use the class method attr_accessor to automatically define getters and setters for instance variables. CSC 440: Software Engineering Slide #57

58 Getter and Setter Methods, cont d irb(main):153:0> class MutablePoint irb(main):154:1> attr_accessor :x, :y irb(main):155:1> irb(main):156:1* def initialize(x, = x, y irb(main):158:2> end irb(main):159:1> end :initialize irb(main):162:0> p = MutablePoint.new(10, irb(main):164:0> p.x => 10 irb(main):165:0> p.x = 100 => 100 irb(main):166:0> p CSC 440: Software Engineering Slide #58

59 Getter and Setter Methods, cont d Use attr_reader to define only getters. You can re-open an already-defined class at run time to dynamically add methods, such as new getters and setters. irb(main):147:0> class Person irb(main):148:1> attr_accessor :name irb(main):149:1> end => nil irb(main):150:0> guy.name => "Ron" irb(main):151:0> guy.name = "Bill" => "Bill" irb(main):152:0> guy.greet Hi, I'm Bill. => nil CSC 440: Software Engineering Slide #59

60 Ruby has Single Inheritance A student is a person. irb(main):175:0> class Student < Person irb(main):176:1> def study irb(main):177:2> puts "ZzzzZzzz" irb(main):178:2> end irb(main):179:1> end => :study irb(main):180:0> stud = Student.new("Julie") => irb(main):181:0> stud.greet Hi, I'm Julie. => nil irb(main):182:0> stud.study ZzzzZzzz => nil CSC 440: Software Engineering Slide #60

61 Ruby Formatted Output Ruby has a printf function similar to C. Example: irb(main):009:0> i = 10 => 10 irb(main):010:0> str = "Foo" => "Foo" irb(main):011:0> printf("%5d %s\n", i, str) 10 Foo => nil 61

62 Ruby File I/O Use File.open to open a text file for reading. Example: irb(main):012:0> input = File.open("widgets.csv", "r") => #<File:widgets.csv> Use readline to read the next text line. Example: irb(main):013:0> input.readline => "STATE,PLANT,DEPT,EMPID,NAME,COUNT\n" CSC 440: Software Engineering Slide #62

63 Ruby File I/O Loop to read and process one text line after another. Example: irb(main):014:0> input.each do line irb(main):015:1* puts line irb(main):016:1> end 12,34,56,789,George Carter,4 12,34,56,799,Mary Clinton,6 12,34,57,639,Alfred Lincoln,8 12,40,57,710,Kim Kennedy,8 12,40,57,990,Jina Johnson,6 12,40,75,426,Ruby Roosevelt,10 12,40,75,551,John Washington,7 33,22,11,297,Hilda Hoover,10 33,22,11,428,Ted Truman,11 33,22,11,808,Nora Nixon,3 33,22,14,629,Mabel Bush,9 33,27,19,321,Chris Adams,5 => #<File:widgets.csv> CSC 440: Software Engineering Slide #63

64 Assignment #1: Ruby Program Print a detail report with rolled-up sums. Input will be a CSV (comma-separated values) text file generated from an Excel spreadsheet. The first line of the file contains column headers. The subsequent detail lines each contains how many widgets an employee made. STATE,PLANT,DEPT,EMPID,NAME,COUNT 12,34,56,789,George Carter,4 12,34,56,799,Mary Clinton,6 12,34,57,639,Alfred Lincoln,8 12,40,57,710,Kim Kennedy,8... CSC 440: Software Engineering Slide #64

65 Assignment #1, cont d STATE,PLANT,DEPT,EMPID,NAME,COUNT 12,34,56,789,George Carter,4 12,34,56,799,Mary Clinton,6 12,34,57,639,Alfred Lincoln,8 12,40,57,710,Kim Kennedy,8... Each detail line contains: State code Plant code Department code Employee ID Employee name Count of widgets made by the employee CSC 440: Software Engineering Slide #65

66 Assignment #1, cont d STATE,PLANT,DEPT,EMPID,NAME,COUNT 12,34,56,789,George Carter,4 12,34,56,799,Mary Clinton,6 12,34,57,639,Alfred Lincoln,8 12,40,57,710,Kim Kennedy,8... A state contains one or more plants. A plant contains one or more departments. A department has one or more employees. Each plant s department codes are separate from another plant s department codes. Detail lines are sorted first by state code, then by plant code, then by department code, then by employee ID. CSC 440: Software Engineering Slide #66

67 Assignment #1, cont d A detail report contains the information from all the input detail lines. The report totals for each department the number of widgets made by the employees of that department. It totals for each plant the number of widgets made by the departments of that plant. It totals for each state the number of widgets made by the plants of that state. It computes the grand total number of widgets. CSC 440: Software Engineering Slide #67

68 Assignment #1, cont d Input file widgets.csv: STATE,PLANT,DEPT,EMPID,NAME,COUNT 12,34,56,789,George Carter,4 12,34,56,799,Mary Clinton,6 12,34,57,639,Alfred Lincoln,8 12,40,57,710,Kim Kennedy,8 12,40,57,990,Jina Johnson,6 12,40,75,426,Ruby Roosevelt,10 12,40,75,551,John Washington,7 33,22,11,297,Hilda Hoover,10 33,22,11,428,Ted Truman,11 33,22,11,808,Nora Nixon,3 33,22,14,629,Mabel Bush,9 33,27,19,321,Chris Adams,5 CSC 440: Software Engineering Slide #68

69 STATE PLANT DEPT EMPID COUNT NAME Assignment #1 Final output: Your output should have the same field spacing and blank lines. The stars indicate the levels of total George Carter Mary Clinton 10 TOTAL FOR DEPT 56 * Alfred Lincoln 8 TOTAL FOR DEPT 57 * 18 TOTAL FOR PLANT 34 ** Kim Kennedy Jina Johnson 14 TOTAL FOR DEPT 57 * Ruby Roosevelt John Washington 17 TOTAL FOR DEPT 75 * 31 TOTAL FOR PLANT 40 ** 49 TOTAL FOR STATE 12 *** Hilda Hoover Ted Truman Nora Nixon 24 TOTAL FOR DEPT 11 * Mabel Bush 9 TOTAL FOR DEPT 14 * 33 TOTAL FOR PLANT 22 ** Chris Adams 5 TOTAL FOR DEPT 19 * 5 TOTAL FOR PLANT 27 ** 38 TOTAL FOR STATE 33 *** 87 GRAND TOTAL **** CSC 440: Software Engineering Slide #69

70 Assignment #1, cont d This is an individual assignment to be done by each student. Create a zip file containing: Your Ruby program Widgets.rb A text file containing output from running your program. Cut and paste from the standard output. Submit your program to Blackboard: Assignment #1 Due Monday, August 29 at 6:00 PM CSC 440: Software Engineering Slide #70

71 Acknowledgements Many slides in this presentation are adapted from slides created by Professor Ron Mak at SJSU. CSC 440: Software Engineering Slide #71

Ruby: Introduction, Basics

Ruby: Introduction, Basics Ruby: Introduction, Basics Computer Science and Engineering College of Engineering The Ohio State University Lecture 4 Ruby vs Java: Similarities Imperative and object-oriented Classes and instances (ie

More information

Ruby: Introduction, Basics

Ruby: Introduction, Basics Ruby: Introduction, Basics Computer Science and Engineering College of Engineering The Ohio State University Lecture 4 Ruby vs Java: Similarities Imperative and object-oriented Classes and instances (ie

More information

Lecture 1. Basic Ruby 1 / 61

Lecture 1. Basic Ruby 1 / 61 Lecture 1 Basic Ruby 1 / 61 What does this do? 3.times do print 'Hello, world!' end 2 / 61 Why Ruby? Optimized for programmer happiness Used for Ruby on Rails Very popular web framework 3 / 61 Course Policies

More information

15.1 Origins and Uses of Ruby

15.1 Origins and Uses of Ruby 15.1 Origins and Uses of Ruby - Designed by Yukihiro Matsumoto; released in 1996 - Use spread rapidly in Japan - Use is now growing in part because of its use in Rails - A pure object-oriented purely interpreted

More information

Ruby: Introduction, Basics

Ruby: Introduction, Basics Ruby: Introduction, Basics Computer Science and Engineering College of Engineering The Ohio State University Lecture 3 Ruby vs Java: Similarities Imperative and object-oriented Classes and instances (ie

More information

Course Outline. Introduction to java

Course Outline. Introduction to java Course Outline 1. Introduction to OO programming 2. Language Basics Syntax and Semantics 3. Algorithms, stepwise refinements. 4. Quiz/Assignment ( 5. Repetitions (for loops) 6. Writing simple classes 7.

More information

PRG PROGRAMMING ESSENTIALS. Lecture 2 Program flow, Conditionals, Loops

PRG PROGRAMMING ESSENTIALS. Lecture 2 Program flow, Conditionals, Loops PRG PROGRAMMING ESSENTIALS 1 Lecture 2 Program flow, Conditionals, Loops https://cw.fel.cvut.cz/wiki/courses/be5b33prg/start Michal Reinštein Czech Technical University in Prague, Faculty of Electrical

More information

CS 5142 Scripting Languages

CS 5142 Scripting Languages CS 5142 Scripting Languages 10/25/2012 Ruby 1 Outline Ruby Martin Hirzel 2 About Ruby Invented 1995 by Yokihiro Matz Matsumoto Influenced by SmallTalk Everything is an object (even e.g., integers) Blocks

More information

Your First Ruby Script

Your First Ruby Script Learn Ruby in 50 pages Your First Ruby Script Step-By-Step Martin Miliauskas @mmiliauskas 1 Your First Ruby Script, Step-By-Step By Martin Miliauskas Published in 2013 by Martin Miliauskas On the web:

More information

Intro. Scheme Basics. scm> 5 5. scm>

Intro. Scheme Basics. scm> 5 5. scm> Intro Let s take some time to talk about LISP. It stands for LISt Processing a way of coding using only lists! It sounds pretty radical, and it is. There are lots of cool things to know about LISP; if

More information

Ex: If you use a program to record sales, you will want to remember data:

Ex: If you use a program to record sales, you will want to remember data: Data Variables Programs need to remember values. Ex: If you use a program to record sales, you will want to remember data: A loaf of bread was sold to Sione Latu on 14/02/19 for T$1.00. Customer Name:

More information

A Tour of Ruby.... for Java programmers

A Tour of Ruby.... for Java programmers A Tour of Ruby... for Java programmers Everything has a value Everything has a value, which I'll show in a comment (following Matsumoto): 1234 # => 1234 2 + 2 # => 4 'Hello' + 'World' # => 'HelloWorld'

More information

\n is used in a string to indicate the newline character. An expression produces data. The simplest expression

\n is used in a string to indicate the newline character. An expression produces data. The simplest expression Chapter 1 Summary Comments are indicated by a hash sign # (also known as the pound or number sign). Text to the right of the hash sign is ignored. (But, hash loses its special meaning if it is part of

More information

CHAPTER 3: CORE PROGRAMMING ELEMENTS

CHAPTER 3: CORE PROGRAMMING ELEMENTS Variables CHAPTER 3: CORE PROGRAMMING ELEMENTS Introduction to Computer Science Using Ruby A variable is a single datum or an accumulation of data attached to a name The datum is (or data are) stored in

More information

S206E Lecture 19, 5/24/2016, Python an overview

S206E Lecture 19, 5/24/2016, Python an overview S206E057 Spring 2016 Copyright 2016, Chiu-Shui Chan. All Rights Reserved. Global and local variables: differences between the two Global variable is usually declared at the start of the program, their

More information

Overview of the Ruby Language. By Ron Haley

Overview of the Ruby Language. By Ron Haley Overview of the Ruby Language By Ron Haley Outline Ruby About Ruby Installation Basics Ruby Conventions Arrays and Hashes Symbols Control Structures Regular Expressions Class vs. Module Blocks, Procs,

More information

Language Reference Manual

Language Reference Manual ALACS Language Reference Manual Manager: Gabriel Lopez (gal2129) Language Guru: Gabriel Kramer-Garcia (glk2110) System Architect: Candace Johnson (crj2121) Tester: Terence Jacobs (tj2316) Table of Contents

More information

CS 390 Software Engineering Lecture 6 Ruby

CS 390 Software Engineering Lecture 6 Ruby CS 390 Software Engineering Lecture 6 Ruby References: Ruby in Twenty Minutes, available at https://www.ruby-lang.org/en/documentation/quickstart/. Outline Clone Ruby example git repository $ git clone

More information

SCHEME 7. 1 Introduction. 2 Primitives COMPUTER SCIENCE 61A. October 29, 2015

SCHEME 7. 1 Introduction. 2 Primitives COMPUTER SCIENCE 61A. October 29, 2015 SCHEME 7 COMPUTER SCIENCE 61A October 29, 2015 1 Introduction In the next part of the course, we will be working with the Scheme programming language. In addition to learning how to write Scheme programs,

More information

Java+- Language Reference Manual

Java+- Language Reference Manual Fall 2016 COMS4115 Programming Languages & Translators Java+- Language Reference Manual Authors Ashley Daguanno (ad3079) - Manager Anna Wen (aw2802) - Tester Tin Nilar Hlaing (th2520) - Systems Architect

More information

CS 115 Lecture 4. More Python; testing software. Neil Moore

CS 115 Lecture 4. More Python; testing software. Neil Moore CS 115 Lecture 4 More Python; testing software Neil Moore Department of Computer Science University of Kentucky Lexington, Kentucky 40506 neil@cs.uky.edu 8 September 2015 Syntax: Statements A statement

More information

Chapter 1 Summary. Chapter 2 Summary. end of a string, in which case the string can span multiple lines.

Chapter 1 Summary. Chapter 2 Summary. end of a string, in which case the string can span multiple lines. Chapter 1 Summary Comments are indicated by a hash sign # (also known as the pound or number sign). Text to the right of the hash sign is ignored. (But, hash loses its special meaning if it is part of

More information

DaMPL. Language Reference Manual. Henrique Grando

DaMPL. Language Reference Manual. Henrique Grando DaMPL Language Reference Manual Bernardo Abreu Felipe Rocha Henrique Grando Hugo Sousa bd2440 flt2107 hp2409 ha2398 Contents 1. Getting Started... 4 2. Syntax Notations... 4 3. Lexical Conventions... 4

More information

Web Application Development (WAD) V th Sem BBAITM(Unit-1) By: Binit Patel

Web Application Development (WAD) V th Sem BBAITM(Unit-1) By: Binit Patel Web Application Development (WAD) V th Sem BBAITM(Unit-1) By: Binit Patel Introduction: PHP (Hypertext Preprocessor) was invented by Rasmus Lerdorf in 1994. First it was known as Personal Home Page. Later

More information

CGS 3066: Spring 2015 JavaScript Reference

CGS 3066: Spring 2015 JavaScript Reference CGS 3066: Spring 2015 JavaScript Reference Can also be used as a study guide. Only covers topics discussed in class. 1 Introduction JavaScript is a scripting language produced by Netscape for use within

More information

Ruby. Mooly Sagiv. Most slides taken from Dan Grossman

Ruby. Mooly Sagiv. Most slides taken from Dan Grossman Ruby Mooly Sagiv Most slides taken from Dan Grossman Ruby dynamic, reflective, object-oriented, general-purpose programming language Designed and developed in the mid-1990s by Yukihiro "Matz" Matsumoto

More information

Basic Data Types and Operators CS 8: Introduction to Computer Science, Winter 2019 Lecture #2

Basic Data Types and Operators CS 8: Introduction to Computer Science, Winter 2019 Lecture #2 Basic Data Types and Operators CS 8: Introduction to Computer Science, Winter 2019 Lecture #2 Ziad Matni, Ph.D. Dept. of Computer Science, UCSB Your Instructor Your instructor: Ziad Matni, Ph.D(zee-ahd

More information

Lecture 2. Object Orientation

Lecture 2. Object Orientation Lecture 2 Object Orientation 1 Homework 0 Grades Homework 0 grades were returned earlier this week Any questions? 2 Homework 1 Homework 1 is due tonight at 11:59pm You will be graded on: Correctness: 15

More information

Summer 2017 Discussion 10: July 25, Introduction. 2 Primitives and Define

Summer 2017 Discussion 10: July 25, Introduction. 2 Primitives and Define CS 6A Scheme Summer 207 Discussion 0: July 25, 207 Introduction In the next part of the course, we will be working with the Scheme programming language. In addition to learning how to write Scheme programs,

More information

Learning Language. Reference Manual. George Liao (gkl2104) Joseanibal Colon Ramos (jc2373) Stephen Robinson (sar2120) Huabiao Xu(hx2104)

Learning Language. Reference Manual. George Liao (gkl2104) Joseanibal Colon Ramos (jc2373) Stephen Robinson (sar2120) Huabiao Xu(hx2104) Learning Language Reference Manual 1 George Liao (gkl2104) Joseanibal Colon Ramos (jc2373) Stephen Robinson (sar2120) Huabiao Xu(hx2104) A. Introduction Learning Language is a programming language designed

More information

PHP and MySQL for Dynamic Web Sites. Intro Ed Crowley

PHP and MySQL for Dynamic Web Sites. Intro Ed Crowley PHP and MySQL for Dynamic Web Sites Intro Ed Crowley Class Preparation If you haven t already, download the sample scripts from: http://www.larryullman.com/books/phpand-mysql-for-dynamic-web-sitesvisual-quickpro-guide-4thedition/#downloads

More information

SCHEME 8. 1 Introduction. 2 Primitives COMPUTER SCIENCE 61A. March 23, 2017

SCHEME 8. 1 Introduction. 2 Primitives COMPUTER SCIENCE 61A. March 23, 2017 SCHEME 8 COMPUTER SCIENCE 61A March 2, 2017 1 Introduction In the next part of the course, we will be working with the Scheme programming language. In addition to learning how to write Scheme programs,

More information

Lecture 2. Object Orientation 1 / 50

Lecture 2. Object Orientation 1 / 50 Lecture 2 Object Orientation 1 / 50 Homework 1 Homework 1 was due last night You will be graded on: Correctness: 15 points (passing all RSpec tests) Style: 5 points (having no Rubocop style offenses) Best

More information

Professor: Sana Odeh Lecture 3 Python 3.1 Variables, Primitive Data Types & arithmetic operators

Professor: Sana Odeh Lecture 3 Python 3.1 Variables, Primitive Data Types & arithmetic operators 1 Professor: Sana Odeh odeh@courant.nyu.edu Lecture 3 Python 3.1 Variables, Primitive Data Types & arithmetic operators Review What s wrong with this line of code? print( He said Hello ) What s wrong with

More information

Intro to Programming. Unit 7. What is Programming? What is Programming? Intro to Programming

Intro to Programming. Unit 7. What is Programming? What is Programming? Intro to Programming Intro to Programming Unit 7 Intro to Programming 1 What is Programming? 1. Programming Languages 2. Markup vs. Programming 1. Introduction 2. Print Statement 3. Strings 4. Types and Values 5. Math Externals

More information

Inheritance and Interfaces

Inheritance and Interfaces Inheritance and Interfaces Object Orientated Programming in Java Benjamin Kenwright Outline Review What is Inheritance? Why we need Inheritance? Syntax, Formatting,.. What is an Interface? Today s Practical

More information

Introduction to: Computers & Programming: Review prior to 1 st Midterm

Introduction to: Computers & Programming: Review prior to 1 st Midterm Introduction to: Computers & Programming: Review prior to 1 st Midterm Adam Meyers New York University Summary Some Procedural Matters Summary of what you need to Know For the Test and To Go Further in

More information

Scheme: Expressions & Procedures

Scheme: Expressions & Procedures Scheme: Expressions & Procedures CS F331 Programming Languages CSCE A331 Programming Language Concepts Lecture Slides Friday, March 31, 2017 Glenn G. Chappell Department of Computer Science University

More information

Introduction CMSC 330: Organization of Programming Languages. Books on Ruby. Applications of Scripting Languages

Introduction CMSC 330: Organization of Programming Languages. Books on Ruby. Applications of Scripting Languages Introduction CMSC 330: Organization of Programming Languages Ruby is an object-oriented, imperative scripting language I wanted a scripting language that was more powerful than Perl, and more object-oriented

More information

CS1 Lecture 3 Jan. 18, 2019

CS1 Lecture 3 Jan. 18, 2019 CS1 Lecture 3 Jan. 18, 2019 Office hours for Prof. Cremer and for TAs have been posted. Locations will change check class website regularly First homework assignment will be available Monday evening, due

More information

CSE 413 Spring Introduction to Ruby. Credit: Dan Grossman, CSE341

CSE 413 Spring Introduction to Ruby. Credit: Dan Grossman, CSE341 CSE 413 Spring 2011 Introduction to Ruby Credit: Dan Grossman, CSE341 Why? Because: Pure object-oriented language Interesting, not entirely obvious implications Interesting design decisions Type system,

More information

CSCE 120: Learning To Code

CSCE 120: Learning To Code CSCE 120: Learning To Code Manipulating Data I Introduction This module is designed to get you started working with data by understanding and using variables and data types in JavaScript. It will also

More information

COMP-202 Unit 2: Java Basics. CONTENTS: Using Expressions and Variables Types Strings Methods

COMP-202 Unit 2: Java Basics. CONTENTS: Using Expressions and Variables Types Strings Methods COMP-202 Unit 2: Java Basics CONTENTS: Using Expressions and Variables Types Strings Methods Assignment 1 Assignment 1 posted on WebCt and course website. It is due May 18th st at 23:30 Worth 6% Part programming,

More information

CMPT 125: Lecture 3 Data and Expressions

CMPT 125: Lecture 3 Data and Expressions CMPT 125: Lecture 3 Data and Expressions Tamara Smyth, tamaras@cs.sfu.ca School of Computing Science, Simon Fraser University January 3, 2009 1 Character Strings A character string is an object in Java,

More information

At full speed with Python

At full speed with Python At full speed with Python João Ventura v0.1 Contents 1 Introduction 2 2 Installation 3 2.1 Installing on Windows............................ 3 2.2 Installing on macos............................. 5 2.3

More information

age = 23 age = age + 1 data types Integers Floating-point numbers Strings Booleans loosely typed age = In my 20s

age = 23 age = age + 1 data types Integers Floating-point numbers Strings Booleans loosely typed age = In my 20s Intro to Python Python Getting increasingly more common Designed to have intuitive and lightweight syntax In this class, we will be using Python 3.x Python 2.x is still very popular, and the differences

More information

Contents. Jairo Pava COMS W4115 June 28, 2013 LEARN: Language Reference Manual

Contents. Jairo Pava COMS W4115 June 28, 2013 LEARN: Language Reference Manual Jairo Pava COMS W4115 June 28, 2013 LEARN: Language Reference Manual Contents 1 Introduction...2 2 Lexical Conventions...2 3 Types...3 4 Syntax...3 5 Expressions...4 6 Declarations...8 7 Statements...9

More information

Overview: Programming Concepts. Programming Concepts. Names, Values, And Variables

Overview: Programming Concepts. Programming Concepts. Names, Values, And Variables Chapter 18: Get With the Program: Fundamental Concepts Expressed in JavaScript Fluency with Information Technology Third Edition by Lawrence Snyder Overview: Programming Concepts Programming: Act of formulating

More information

Overview: Programming Concepts. Programming Concepts. Chapter 18: Get With the Program: Fundamental Concepts Expressed in JavaScript

Overview: Programming Concepts. Programming Concepts. Chapter 18: Get With the Program: Fundamental Concepts Expressed in JavaScript Chapter 18: Get With the Program: Fundamental Concepts Expressed in JavaScript Fluency with Information Technology Third Edition by Lawrence Snyder Overview: Programming Concepts Programming: Act of formulating

More information

Ruby Topic Maps. Introduction to Ruby. Benjamin Bock.

Ruby Topic Maps. Introduction to Ruby. Benjamin Bock. Ruby Topic Maps http://rtm.rubyforge.org Introduction to Ruby Benjamin Bock 1 Calculator irb(main):001:0> 1+2 Type irb in your Terminal / Command / Shell window to start the interactive Ruby interpreter

More information

Program Fundamentals

Program Fundamentals Program Fundamentals /* HelloWorld.java * The classic Hello, world! program */ class HelloWorld { public static void main (String[ ] args) { System.out.println( Hello, world! ); } } /* HelloWorld.java

More information

BASIC ELEMENTS OF A COMPUTER PROGRAM

BASIC ELEMENTS OF A COMPUTER PROGRAM BASIC ELEMENTS OF A COMPUTER PROGRAM CSC128 FUNDAMENTALS OF COMPUTER PROBLEM SOLVING LOGO Contents 1 Identifier 2 3 Rules for naming and declaring data variables Basic data types 4 Arithmetic operators

More information

2/5/2018. Expressions are Used to Perform Calculations. ECE 220: Computer Systems & Programming. Our Class Focuses on Four Types of Operator in C

2/5/2018. Expressions are Used to Perform Calculations. ECE 220: Computer Systems & Programming. Our Class Focuses on Four Types of Operator in C University of Illinois at Urbana-Champaign Dept. of Electrical and Computer Engineering ECE 220: Computer Systems & Programming Expressions and Operators in C (Partially a Review) Expressions are Used

More information

Computer Components. Software{ User Programs. Operating System. Hardware

Computer Components. Software{ User Programs. Operating System. Hardware Computer Components Software{ User Programs Operating System Hardware What are Programs? Programs provide instructions for computers Similar to giving directions to a person who is trying to get from point

More information

The Three Rules. Program. What is a Computer Program? 5/30/2018. Interpreted. Your First Program QuickStart 1. Chapter 1

The Three Rules. Program. What is a Computer Program? 5/30/2018. Interpreted. Your First Program QuickStart 1. Chapter 1 The Three Rules Chapter 1 Beginnings Rule 1: Think before you program Rule 2: A program is a human-readable essay on problem solving that also executes on a computer Rule 3: The best way to improve your

More information

CSCI 2010 Principles of Computer Science. Data and Expressions 08/09/2013 CSCI

CSCI 2010 Principles of Computer Science. Data and Expressions 08/09/2013 CSCI CSCI 2010 Principles of Computer Science Data and Expressions 08/09/2013 CSCI 2010 1 Data Types, Variables and Expressions in Java We look at the primitive data types, strings and expressions that are

More information

Full file at

Full file at Java Programming: From Problem Analysis to Program Design, 3 rd Edition 2-1 Chapter 2 Basic Elements of Java At a Glance Instructor s Manual Table of Contents Overview Objectives s Quick Quizzes Class

More information

Objectives. In this chapter, you will:

Objectives. In this chapter, you will: Objectives In this chapter, you will: Become familiar with functions, special symbols, and identifiers in C++ Explore simple data types Discover how a program evaluates arithmetic expressions Learn about

More information

Programming Logic and Design Seventh Edition Chapter 2 Elements of High-Quality Programs

Programming Logic and Design Seventh Edition Chapter 2 Elements of High-Quality Programs Programming Logic and Design Chapter 2 Elements of High-Quality Programs Objectives In this chapter, you will learn about: Declaring and using variables and constants Assigning values to variables [assignment

More information

MIT AITI Python Software Development

MIT AITI Python Software Development MIT AITI Python Software Development PYTHON L02: In this lab we practice all that we have learned on variables (lack of types), naming conventions, numeric types and coercion, strings, booleans, operator

More information

Chapter 3 Syntax, Errors, and Debugging. Fundamentals of Java

Chapter 3 Syntax, Errors, and Debugging. Fundamentals of Java Chapter 3 Syntax, Errors, and Debugging Objectives Construct and use numeric and string literals. Name and use variables and constants. Create arithmetic expressions. Understand the precedence of different

More information

The C++ Language. Arizona State University 1

The C++ Language. Arizona State University 1 The C++ Language CSE100 Principles of Programming with C++ (based off Chapter 2 slides by Pearson) Ryan Dougherty Arizona State University http://www.public.asu.edu/~redoughe/ Arizona State University

More information

Unit E Step-by-Step: Programming with Python

Unit E Step-by-Step: Programming with Python Unit E Step-by-Step: Programming with Python Computer Concepts 2016 ENHANCED EDITION 1 Unit Contents Section A: Hello World! Python Style Section B: The Wacky Word Game Section C: Build Your Own Calculator

More information

CS1 Lecture 2 Jan. 16, 2019

CS1 Lecture 2 Jan. 16, 2019 CS1 Lecture 2 Jan. 16, 2019 Contacting me/tas by email You may send questions/comments to me/tas by email. For discussion section issues, sent to TA and me For homework or other issues send to me (your

More information

Basics of Java Programming

Basics of Java Programming Basics of Java Programming Lecture 2 COP 3252 Summer 2017 May 16, 2017 Components of a Java Program statements - A statement is some action or sequence of actions, given as a command in code. A statement

More information

A.A. 2008/09. Why introduce JavaScript. G. Cecchetti Internet Software Technologies

A.A. 2008/09. Why introduce JavaScript. G. Cecchetti Internet Software Technologies Internet t Software Technologies JavaScript part one IMCNE A.A. 2008/09 Gabriele Cecchetti Why introduce JavaScript To add dynamicity and interactivity to HTML pages 2 What s a script It s a little interpreted

More information

Language Basics. /* The NUMBER GAME - User tries to guess a number between 1 and 10 */ /* Generate a random number between 1 and 10 */

Language Basics. /* The NUMBER GAME - User tries to guess a number between 1 and 10 */ /* Generate a random number between 1 and 10 */ Overview Language Basics This chapter describes the basic elements of Rexx. It discusses the simple components that make up the language. These include script structure, elements of the language, operators,

More information

Lecture 2: Variables and Operators. AITI Nigeria Summer 2012 University of Lagos.

Lecture 2: Variables and Operators. AITI Nigeria Summer 2012 University of Lagos. Lecture 2: Variables and Operators AITI Nigeria Summer 2012 University of Lagos. Agenda Variables Types Naming Assignment Data Types Type casting Operators Declaring Variables in Java type name; Variables

More information

Java How to Program, 10/e. Copyright by Pearson Education, Inc. All Rights Reserved.

Java How to Program, 10/e. Copyright by Pearson Education, Inc. All Rights Reserved. Java How to Program, 10/e Education, Inc. All Rights Reserved. Each class you create becomes a new type that can be used to declare variables and create objects. You can declare new classes as needed;

More information

Chapter 2 C++ Fundamentals

Chapter 2 C++ Fundamentals Chapter 2 C++ Fundamentals 3rd Edition Computing Fundamentals with C++ Rick Mercer Franklin, Beedle & Associates Goals Reuse existing code in your programs with #include Obtain input data from the user

More information

Swift. Introducing swift. Thomas Woodfin

Swift. Introducing swift. Thomas Woodfin Swift Introducing swift Thomas Woodfin Content Swift benefits Programming language Development Guidelines Swift benefits What is Swift Benefits What is Swift New programming language for ios and OS X Development

More information

Spoke. Language Reference Manual* CS4118 PROGRAMMING LANGUAGES AND TRANSLATORS. William Yang Wang, Chia-che Tsai, Zhou Yu, Xin Chen 2010/11/03

Spoke. Language Reference Manual* CS4118 PROGRAMMING LANGUAGES AND TRANSLATORS. William Yang Wang, Chia-che Tsai, Zhou Yu, Xin Chen 2010/11/03 CS4118 PROGRAMMING LANGUAGES AND TRANSLATORS Spoke Language Reference Manual* William Yang Wang, Chia-che Tsai, Zhou Yu, Xin Chen 2010/11/03 (yw2347, ct2459, zy2147, xc2180)@columbia.edu Columbia University,

More information

Administrivia. Simple data types

Administrivia. Simple data types Administrivia Lists, higher order procedures, and symbols 6.037 - Structure and Interpretation of Computer Programs Mike Phillips (mpp) Massachusetts Institute of Technology Project 0 was due today Reminder:

More information

Accelerating Information Technology Innovation

Accelerating Information Technology Innovation Accelerating Information Technology Innovation http://aiti.mit.edu Cali, Colombia Summer 2012 Lesson 02 Variables and Operators Agenda Variables Types Naming Assignment Data Types Type casting Operators

More information

DEPARTMENT OF MATHS, MJ COLLEGE

DEPARTMENT OF MATHS, MJ COLLEGE T. Y. B.Sc. Mathematics MTH- 356 (A) : Programming in C Unit 1 : Basic Concepts Syllabus : Introduction, Character set, C token, Keywords, Constants, Variables, Data types, Symbolic constants, Over flow,

More information

LECTURE 02 INTRODUCTION TO C++

LECTURE 02 INTRODUCTION TO C++ PowerPoint Slides adapted from *Starting Out with C++: From Control Structures through Objects, 7/E* by *Tony Gaddis* Copyright 2012 Pearson Education Inc. COMPUTER PROGRAMMING LECTURE 02 INTRODUCTION

More information

CS 112 Introduction to Computing II. Wayne Snyder Computer Science Department Boston University

CS 112 Introduction to Computing II. Wayne Snyder Computer Science Department Boston University CS 112 Introduction to Computing II Wayne Snyder Department Boston University Today: Java basics: Compilation vs Interpretation Program structure Statements Values Variables Types Operators and Expressions

More information

Object Oriented Programming with Java

Object Oriented Programming with Java Object Oriented Programming with Java What is Object Oriented Programming? Object Oriented Programming consists of creating outline structures that are easily reused over and over again. There are four

More information

Computer Programming : C++

Computer Programming : C++ The Islamic University of Gaza Engineering Faculty Department of Computer Engineering Fall 2017 ECOM 2003 Muath i.alnabris Computer Programming : C++ Experiment #1 Basics Contents Structure of a program

More information

REVIEW. The C++ Programming Language. CS 151 Review #2

REVIEW. The C++ Programming Language. CS 151 Review #2 REVIEW The C++ Programming Language Computer programming courses generally concentrate on program design that can be applied to any number of programming languages on the market. It is imperative, however,

More information

CHIL CSS HTML Integrated Language

CHIL CSS HTML Integrated Language CHIL CSS HTML Integrated Language Programming Languages and Translators Fall 2013 Authors: Gil Chen Zion gc2466 Ami Kumar ak3284 Annania Melaku amm2324 Isaac White iaw2105 Professor: Prof. Stephen A. Edwards

More information

Fundamental of Programming (C)

Fundamental of Programming (C) Borrowed from lecturer notes by Omid Jafarinezhad Fundamental of Programming (C) Lecturer: Vahid Khodabakhshi Lecture 3 Constants, Variables, Data Types, And Operations Department of Computer Engineering

More information

Excel Formulas and Functions

Excel Formulas and Functions Excel Formulas and Functions Formulas Relative cell references Absolute cell references Mixed cell references Naming a cell or range Naming constants Dates and times Natural-language formulas Functions

More information

Arithmetic and IO. 25 August 2017

Arithmetic and IO. 25 August 2017 Arithmetic and IO 25 August 2017 Submissions you can submit multiple times to the homework dropbox file name: uppercase first letter, Yourlastname0829.java the system will use the last submission before

More information

CS1 Lecture 3 Jan. 22, 2018

CS1 Lecture 3 Jan. 22, 2018 CS1 Lecture 3 Jan. 22, 2018 Office hours for me and for TAs have been posted, locations will change check class website regularly First homework available, due Mon., 9:00am. Discussion sections tomorrow

More information

Chapter 2: Data and Expressions

Chapter 2: Data and Expressions Chapter 2: Data and Expressions CS 121 Department of Computer Science College of Engineering Boise State University August 21, 2017 Chapter 2: Data and Expressions CS 121 1 / 51 Chapter 1 Terminology Review

More information

Computer Programming C++ (wg) CCOs

Computer Programming C++ (wg) CCOs Computer Programming C++ (wg) CCOs I. The student will analyze the different systems, and languages of the computer. (SM 1.4, 3.1, 3.4, 3.6) II. The student will write, compile, link and run a simple C++

More information

CS 211 Programming Practicum Spring 2017

CS 211 Programming Practicum Spring 2017 Due: Tuesday, 3/28/17 at 11:59 pm Infix Expression Evaluator Programming Project 5 For this lab, write a JAVA program that will evaluate an infix expression. The algorithm REQUIRED for this program will

More information

The PCAT Programming Language Reference Manual

The PCAT Programming Language Reference Manual The PCAT Programming Language Reference Manual Andrew Tolmach and Jingke Li Dept. of Computer Science Portland State University September 27, 1995 (revised October 15, 2002) 1 Introduction The PCAT language

More information

IT 374 C# and Applications/ IT695 C# Data Structures

IT 374 C# and Applications/ IT695 C# Data Structures IT 374 C# and Applications/ IT695 C# Data Structures Module 2.1: Introduction to C# App Programming Xianrong (Shawn) Zheng Spring 2017 1 Outline Introduction Creating a Simple App String Interpolation

More information

AP Computer Science A

AP Computer Science A AP Computer Science A 1st Quarter Notes Table of Contents - section links Click on the date or topic below to jump to that section Date : 9/8/2017 Aim : Java Basics Objects and Classes Data types: Primitive

More information

Data and Variables. Data Types Expressions. String Concatenation Variables Declaration Assignment Shorthand operators. Operators Precedence

Data and Variables. Data Types Expressions. String Concatenation Variables Declaration Assignment Shorthand operators. Operators Precedence Data and Variables Data Types Expressions Operators Precedence String Concatenation Variables Declaration Assignment Shorthand operators Review class All code in a java file is written in a class public

More information

2 rd class Department of Programming. OOP with Java Programming

2 rd class Department of Programming. OOP with Java Programming 1. Structured Programming and Object-Oriented Programming During the 1970s and into the 80s, the primary software engineering methodology was structured programming. The structured programming approach

More information

Strings and Variables

Strings and Variables Strings and Variables class Player attr_accessor :name attr_reader :health def initialize(name, health=100) @name = name.capitalize @health = health @found_treasures = Hash.new(0) Inside the initialize

More information

9/5/2018. Overview. The C Programming Language. Transitioning to C from Python. Why C? Hello, world! Programming in C

9/5/2018. Overview. The C Programming Language. Transitioning to C from Python. Why C? Hello, world! Programming in C Overview The C Programming Language (with material from Dr. Bin Ren, William & Mary Computer Science) Motivation Hello, world! Basic Data Types Variables Arithmetic Operators Relational Operators Assignments

More information

Creating a C++ Program

Creating a C++ Program Program A computer program (also software, or just a program) is a sequence of instructions written in a sequence to perform a specified task with a computer. 1 Creating a C++ Program created using an

More information

Datatypes, Variables, and Operations

Datatypes, Variables, and Operations Datatypes, Variables, and Operations 1 Primitive Type Classification 2 Numerical Data Types Name Range Storage Size byte 2 7 to 2 7 1 (-128 to 127) 8-bit signed short 2 15 to 2 15 1 (-32768 to 32767) 16-bit

More information

TOPIC 2 INTRODUCTION TO JAVA AND DR JAVA

TOPIC 2 INTRODUCTION TO JAVA AND DR JAVA 1 TOPIC 2 INTRODUCTION TO JAVA AND DR JAVA Notes adapted from Introduction to Computing and Programming with Java: A Multimedia Approach by M. Guzdial and B. Ericson, and instructor materials prepared

More information

CS 115 Data Types and Arithmetic; Testing. Taken from notes by Dr. Neil Moore

CS 115 Data Types and Arithmetic; Testing. Taken from notes by Dr. Neil Moore CS 115 Data Types and Arithmetic; Testing Taken from notes by Dr. Neil Moore Statements A statement is the smallest unit of code that can be executed on its own. So far we ve seen simple statements: Assignment:

More information

Lesson 10A OOP Fundamentals. By John B. Owen All rights reserved 2011, revised 2014

Lesson 10A OOP Fundamentals. By John B. Owen All rights reserved 2011, revised 2014 Lesson 10A OOP Fundamentals By John B. Owen All rights reserved 2011, revised 2014 Table of Contents Objectives Definition Pointers vs containers Object vs primitives Constructors Methods Object class

More information