Comp Sci 200 Programming I Jim Williams, PhD.

Slides:



Advertisements
Similar presentations
Designing a Program & the Java Programming Language
Advertisements

Begin Java Pepper. Objectives What is a program? Learn the basics of your programming tool: BlueJ Write a first Java program and see it run Make some.
Creating a Program In today’s lesson we will look at: what programming is different types of programs how we create a program installing an IDE to get.
How do we make our Welcome.java program do something? The java in our Welcome.java file won’t do anything by itself. We need to tell the computer to execute.
How do we make our HelloTester.java program do something? The java in our HelloTester.java file won’t do anything by itself. We need to tell the computer.
CMPT 120 Introduction to Computer Science and Programming I Chris Schmidt.
CS211 Data Structures Sami Rollins Fall 2004.
1 Programming Languages Translation  Lecture Objectives:  Be able to list and explain five features of the Java programming language.  Be able to explain.
CS 101 Problem Solving and Structured Programming in C Sami Rollins Spring 2003.
Writing algorithms using the while-statement. Previously discussed Syntax of while-statement:
Writing algorithms using the for-statement. Programming example 1: find all divisors of a number We have seen a program using a while-statement to solve.
The break and continue statements. Introduction There are 2 special statements that can affect the execution of loop statements (such as a while-statement)
Week 2 - Friday.  What did we talk about last time?  Data representation  Binary numbers  Types  int  boolean  double  char  String.
Introducing Java.
©2000, John Wiley & Sons, Inc. Horstmann/Java Essentials, 2/e Chapter 1: Introduction 1 Chapter 1 Introduction.
Java TA Session 1. Software Java Runtime Environment (JRE) java.exe Java Development Kit (JDK) java.exe, javac.exe Version 1.6 = Version 6, Version 1.7.
© 2012 Pearson Education, Inc. All rights reserved. 1-1 Why Java? Needed program portability – Program written in a language that would run on various.
Programming Concept Chapter I Introduction to Java Programming.
Input & Output In Java. Input & Output It is very complicated for a computer to show how information is processed. Although a computer is very good at.
Boolean expressions, part 2: Logical operators. Previously discussed Recall that there are 2 types of operators that return a boolean result (true or.
BUILDING JAVA PROGRAMS CHAPTER 1 ERRORS. 22 OBJECTIVES Recognize different errors that Java uses and how to fix them.
Assignment statements using the same variable in LHS and RHS.
CSci 111 – computer Science I Fall 2014 Cynthia Zickos WRITING A SIMPLE PROGRAM IN JAVA.
Programming Fundamentals 2: Simple/ F II Objectives – –give some simple examples of Java applications and one applet 2. Simple Java.
CS-1030 Dr. Mark L. Hornick 1 Java Review Interactive.
BEGINNING PROGRAMMING.  Literally – giving instructions to a computer so that it does what you want  Practically – using a programming language (such.
CS110 Programming Language I Lab 4: Control Statements I Computer Science Department Spring 2014.
Introduction Chapter 1 8/31 & 9/1 Imagine! Java: Programming Concepts in Context by Frank M. Carrano, (c) Pearson Education - Prentice Hall, 2010.
Overview of Java CSCI 392 Day One. Running C code vs Java code C Source Code C Compiler Object File (machine code) Library Files Linker Executable File.
© 2012 Pearson Education, Inc. All rights reserved types of Java programs Application – Stand-alone program (run without a web browser) – Relaxed.
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.
CHAPTER 1 INTRODUCTION. CHAPTER GOALS To understand the activity of programming To learn about the architecture of computers To learn about machine code.
Introduction to array: why use arrays ?. Motivational example Problem: Write a program that reads in and stores away 5 double numbers After reading in.
©2016 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. CSC 110 – INTRO TO COMPUTING - PROGRAMMING Overview of Programming.
Boolean expressions, part 1: Compare operators. Compare operators Compare operators compare 2 numerical values and return a Boolean (logical) value A.
Simple algorithms on an array - compute sum and min.
COP 2551 Introduction to Object Oriented Programming with Java Topics –Introduction to the Java language –Code Commenting –Java Program Structure –Identifiers.
import java.util.Scanner; class myCode { public static void main(String[] args) { Scanner input= new Scanner(System.in); int num1; System.out.println(“Enter.
Computer Science A 1. Course plan Introduction to programming Basic concepts of typical programming languages. Tools: compiler, editor, integrated editor,
Execution ways of program References: www. en.wikipedia.org/wiki/Integrated_development_environment  You can execute or run a simple java program with.
Review A program is… a set of instructions that tell a computer what to do. Programs can also be called… software. Hardware refers to… the physical components.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
Software Engineering Algorithms, Compilers, & Lifecycle.
CS 201 Lecture 1 (b) Using an IDE Tarik Booker CS 201: Introduction to Programming California State University, Los Angeles.
L AB #3. System.out.println(“if you have” +eggPerBasket + “egg per basket and” + numberOfBaskets +”baskets, then the total number off eggs is“+totalEggs);
Foundations of Programming: Java
Sophomore Scholars Java
Chapter 2 Clarifications
Logger, Assert and Invariants
Compiling and Running a Java Program
CS Programming I Jim Williams, PhD.
Something about Java Introduction to Problem Solving and Programming 1.
Chapter 1 Program Development
CS 302 Week 15 Jim Williams, PhD.
Comp Sci 302 Introduction to Programming
While Statement.
CS Week 3 Jim Williams, PhD.
CS-0401 INTERMEDIATE PROGRAMMING USING JAVA
CSE 1020:Programming by Delegation
Introduction CSC 111.
CS Week 3 Jim Williams.
CS 200 Primitives and Expressions
CS 200 Primitives and Expressions
CS 200 Additional Topics and Review
CS Week 2 Jim Williams, PhD.
CS Programming I Jim Williams, PhD.
F II 2. Simple Java Programs Objectives
Random Numbers while loop
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.
Presentation transcript:

Comp Sci 200 Programming I Jim Williams, PhD

Programming I Who Am I? Who is here? What is Computer Science & Programming? Website & Course Design Trace and explain a program containing basic input and output. Describe the CS200 view of computer Describe the edit-compile-run cycle

CS 200 My Interests: CS Education, specifically the teaching and learning of programming. http://pages.cs.wisc.edu/~jimw/

Who is here?

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.

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

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

Website and Policies https://pages.cs.wisc.edu/~cs200/ https://cs200-www.cs.wisc.edu/wp/ Large Course

CS200 View of Computer A view of the computer appropriate to understand programming with Java. This view of the computer gets more detailed as we go in the course.

CS200 View of Computer (begin) Processor Executes program one step at a time. Java statements say what to do. Memory holds data (and program itself) access through variables and references

Tracing & Explaining Tracing Stepping through a program anticipating what each instruction does and the next instruction to execute (run). Keep track of what is happening in memory. Explaining In your own words, summarize what Java statements do.

Learning to Trace with Java Visualizer Java Visualizer available via our course website or: https://cscircles.cemc.uwaterloo.ca/java_visualize/ import java.util.Scanner; public class RectangleArea { public static void main(String [] args) { Scanner input = new Scanner(System.in); int height = 0; int width = 0; System.out.print("Enter height: "); height = input.nextInt(); System.out.print("Enter width: "); width = input.nextInt(); int area = height * width; System.out.println("A rectangle with height " + height + " and width " + width + " has an area of: " + area); input.close(); return; //optional at end of method, unless returning value }

Programming Process Users Files Programmer Editor (Virtual) Compiler Machine Compiler Hello.java Hello.class Computer Files Programmer

Programming Errors Naming/Saving Syntax/Compile time Runtime & Logic Editor (Virtual) Machine Compiler Hello.java Hello.class Computer Files Programmer

Programming Process Question Cat.txt Cat.java Cat.class Cat For the class named Cat, what is the name of the file that the compiler creates and is provided to the Java Virtual Machine to run?

Edit-Compile-Run Cycle From the command-line: notepad javac java