Comp Sci 302 Introduction to Programming

Slides:



Advertisements
Similar presentations
CS0007: Introduction to Computer Programming Console Output, Variables, Literals, and Introduction to Type.
Advertisements

 2005 Pearson Education, Inc. All rights reserved Introduction.
1 Chapter 2 Introduction to Java Applications Introduction Java application programming Display ____________________ Obtain information from the.
1 9/1/06CS150 Introduction to Computer Science 1 What Data Do We Have? CS 150 Introduction to Computer Science I.
1 September 6, 2005CS150 Introduction to Computer Science I What Actions Do We Have Part 1 CS150 Introduction to Computer Science I.
COMP 110 Introduction to Programming Mr. Joshua Stough September 10, 2007.
Intro to Java Programming  A computer follows the instruction precisely and exactly.  Anything has to be declared and defined before it can be used.
CIS Computer Programming Logic
Goals of Course Introduction to the programming language C Learn how to program Learn ‘good’ programming practices.
PYTHON. Python is a high-level, interpreted, interactive and object- oriented scripting language. Python was designed to be highly readable which uses.
Introduction to Java Thanks to Dan Lunney (SHS). Java Basics File names The “main” method Output to screen Escape Sequence – Special Characters format()
The string data type String. String (in general) A string is a sequence of characters enclosed between the double quotes "..." Example: Each character.
Introduction to Java Applications Part II. In this chapter you will learn:  Different data types( Primitive data types).  How to declare variables?
Logic and Systems A beginner’s guide.
 Pearson Education, Inc. All rights reserved Introduction to Java Applications.
1 Computer Science of Graphics and Games MONT 105S, Spring 2009 Session 1 Simple Python Programs Using Print, Variables, Input.
CSE8A: Introduction to Programming in Java Fall 2012 Prof. Christine Alvarado cse8afall.weebly.com.
More about Java Chapter 2 9/8 & 9/9 Imagine! Java: Programming Concepts in Context by Frank M. Carrano, (c) Pearson Education - Prentice Hall, 2010.
1 CSC 221: Computer Programming I Spring 2008 course overview  What did we set out to learn?  What did you actually learn?  Where do you go from here?
Introduction Chapter 1 8/31 & 9/1 Imagine! Java: Programming Concepts in Context by Frank M. Carrano, (c) Pearson Education - Prentice Hall, 2010.
CSC 1051 M.A. Papalaskari, Villanova University Algorithms Dr. Mary-Angela Papalaskari Department of Computing Sciences Villanova University Course website:
Operators and Expressions. 2 String Concatenation  The plus operator (+) is also used for arithmetic addition  The function that the + operator performs.
CSCI 1226 FALL 2015 MIDTERM #1 REVIEWS.  Types of computers:  Personal computers  Embedded systems  Servers  Hardware:  I/O devices: mice, keyboards,
Welcome to AP Computer Science A We use the Java language, but this class is much more rigorous than Intro to Java More programming, but also more theory.
Reading input from the console input. Java's console input The console is the terminal window that is running the Java program I.e., that's the terminal.
Introduction to Java Applications Part II. In this chapter you will learn:  Different data types( Primitive data types).  How to declare variables?
Introduction Chapter 1 1/22/16. Check zyBooks Completion Click on the boxes for each section.
Introducing Java Chapter 3 Review. Why Program in Java? Java, is an object-oriented programming language. OOP languages evolved out of the need to better.
Programming for Interactivity Professor Bill Tomlinson Tuesday & Wednesday 6:00-7:50pm Fall 2005.
CHAPTER 3 COMPLETING THE PROBLEM- SOLVING PROCESS AND GETTING STARTED WITH C++ An Introduction to Programming with C++ Fifth Edition.
Lecture 4 CS140 Dick Steflik. Reading Keyboard Input Import java.util.Scanner – A simple text scanner which can parse primitive types and strings using.
CS 106A, Lecture 4 Introduction to Java
Input/Output.
What Actions Do We Have Part 1
CSC 221: Computer Programming I Spring 2010
Topic: Python’s building blocks -> Variables, Values, and Types
Introduction to Computer Science / Procedural – 67130
CSC 221: Computer Programming I Fall 2005
Variables, Expressions, and IO
Comp Sci 200 Programming I Jim Williams, PhD.
CS Programming I Jim Williams, PhD.
CS Week 2 Jim Williams, PhD.
Learning to Program in Python
CS 200 Branches Jim Williams, PhD.
CS Week 4 Jim Williams, PhD.
CS 200 Using Objects Jim Williams, PhD.
Learning to Program in Python
CS Week 7 Jim Williams, PhD.
String Input ICS 111: Introduction to Computer Science I
Lesson 2 Programming constructs – Algorithms – Scratch – Variables Intro.
Introduction to C++ Programming
CS Week 3 Jim Williams, PhD.
First Python Program Professor Hugh C. Lauer CS-1004 — Introduction to Programming for Non-Majors (Slides include materials from Python Programming: An.
MSIS 655 Advanced Business Applications Programming
CS Week 3 Jim Williams.
CS 200 Primitives and Expressions
CS 200 Primitives and Expressions
CS 200 Methods, Using Objects
Life is Full of Alternatives
Welcome to AP Computer Science A!
Welcome to AP Computer Science A!
Zorah Fung University of Washington, Spring 2015
Unit 3: Variables in Java
CS Week 2 Jim Williams, PhD.
CS Programming I Jim Williams, PhD.
CS Week 3 Jim Williams, PhD.
Ben Stanley for gAlpha gALPHA free, four-week venture-creation workshop designed to help entrepreneurially-minded students and technologists create high-growth.
CS Programming I Jim Williams, PhD.
Zorah Fung University of Washington, Winter 2016
Presentation transcript:

Comp Sci 302 Introduction to Programming Jim Williams, PhD

What is Computer Science? What is Programming? With a name like computer science, you might think it is all about the computer. Core principles: Abstractions and algorithms This course: Learning to give instructions to the computer. Read and Write Java

What is Computer Science? The study of the computer itself as well as how computers are applied to solve problems in any field. What is Programming? Designing algorithms and writing them in a language a computer can execute.

In Computer Science Lots of puzzles, problem solving and challenge. Opportunity to create something from nothing Opportunity to apply to any field Many enjoy these and find a lot of satisfaction when successful.

CS Core Principles: Algorithms: A step-by-step set of operations to be performed. Abstraction: a technique for managing complexity.

Bloom's Taxonomy of Educational Goals 6. Create: Produce new or original work 5. Evaluate: Justify a stand or decision 4. Analyze: Draw connections among ideas 3. Apply: Use information in new situations 2. Understand: Explain ideas or concepts Remember: Recall facts and basic concepts What level is expected in high school, college? What is required to "get an A"? What is required in order to teach? https://cft.vanderbilt.edu/guides-sub-pages/blooms-taxonomy/

Understand vs. Apply Steph Curry, NBA Golden State Warriors Basketball Analogy Demonstration vs. Practice Declarative Knowledge vs Procedural Knowledge Importance of Practice for learning Steph Curry, NBA Golden State Warriors

Who is in the class?

When Women Stopped Coding http://www.npr.org/sections/money/2014/10/21/357629765/when-women-stopped-coding

Education, Race, Women & Computing Unlocking the Clubhouse By Jane Margolis and Allan Fisher Stuck in the Shallow End By Jane Margolis

Memory, Sequence, Assignment int i; int j; i = 5; j = i; Briefly Explain Draw a picture of memory Walk through Demonstrate in Java Visualizer

What are the values in a, b & c? int a = 5; int b = 7; int c = a; b = c; a = b;

Swap values in a & b int a = 5, b = 3; Write code to swap values in a & b. a = b; b = a; c = b; b = c; c = a; a = c; Google "swapping values without third variable" for many creative ways.

Print Out int numCars = 9; int numTrucks = 4; System.out.print( numCars ); System.out.print( numCars + numTrucks); System.out.println( "numCars" + numTrucks); Ask for results Demonstrate in Java Visualizer

Print Out Starting with: int a = 5; int b = 3; Produce output: a has 5 System.out.print(a has 5); System.out.println(b has 3); System.out.print(a + " has " + 5); System.out.print(b + " has " + 3); System.out.println("a has 5"); System.out.print("b has 3"); System.out.print("a has " + a); System.out.println("b has " + b); Starting with: int a = 5; int b = 3; Produce output: a has 5 b has 3

Escape Sequences Special character sequences within a String \n \" \\ \t System.out.print( "hello\n\t\"hi\"\ngoodbye"); hello "hi" goodbye

What is printed out? System.out.print( "Fred says \"hello\"\nthis morning."); Fred says "hello" this morning. Fred says hello\nthis morning. Fred says \"hello\"

Questions (Degrees Fahrenheit – 32) x 5 / 9 = Degrees Celsius What symbols have different meanings in Java? What changes must be made to implement this equation in Java? Retrieval practice importance of committing to an answer

Eclipse IDE Opening project, copying in files Style and Commenting Guides Strings I/O Calling methods Compiler & Runtime Errors Scanner reading a number

Review (Degrees Fahrenheit – 32) x 5 / 9 = Degrees Celsius What symbols have different meanings in Java? What changes must be made to implement this equation in Java?

My List X vs * equals (==) vs assignment (=) value is stored on the left hand side of assignment (=) operator Variables: name areas of computer memory, declare before use, declare type of data, initialize Variable names: start with letter, include letters numbers and _, but no spaces Conventions: camelCasing, spell out names Semicolon at the end of statements

Read In Values Recall: import java.util.Scanner; Scanner input = new Scanner( System.in); int age = input.nextInt(); String name = input.nextLine(); Use print statements to see what is happening as code is executing.

What are values of variables? name: Minsub\n age: 22\nCS major: name: Minsub\n22\CS age: name: Minsub age: 22 String note = "Minsub\n22\nCS"; Scanner input = new Scanner( note); String name = input.nextLine(); int age = input.nextInt(); String major = input.nextLine();

P1 - M0 Available P1 - Individual work Style and Commenting 4 weekly milestones, Due 8am Thursday P1 - Individual work Discuss concepts, don’t share assignment code Style and Commenting