CS 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.
AP Computer Science. Google Interview Question You are given 8 identical looking balls. One of them is heavier than the rest of the 7 (all the others.
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 to Create a Java program CS115 Fall George Koutsogiannakis.
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.
Introduction to Java.
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.
Using the Java programming language compiler. Review of relevant material from previous lectures From previous lectures: A computer can only execute machine.
Computer Programming Lab(5).
IB Computer Science II Paul Bui
1 Purposes: Learn JAVA 1.What is programming languages 2.How to solve problems by computers 1.a CS major student, get a degree in BS 2.a programmer  system.
From BlueJ to NetBeans SWC 2.semester.
Basics Programming Concepts. Basics A computer program is a set of instructions to tell a computer what to do Machine language = circuit level language.
CS107 Introduction to Computer Science Java Basics.
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.
OOP (Java): Simple/ OOP (Java) Objectives – –give some simple examples of Java applications and one applet 2. Simple Java Programs Semester.
© 2012 Pearson Education, Inc. All rights reserved. 1-1 Why Java? Needed program portability – Program written in a language that would run on various.
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.
CHAPTER 3 GC Java Fundamentals. 2 BASICS OF JAVA ENVIRONMENT  The environment  The language  Java applications programming Interface API  Various.
1 Debugging. 2 A Lot of Time is Spent Debugging Programs Debugging. Cyclic process of editing, compiling, and fixing errors. n Always a logical explanation.
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 4244: Internet Programming Network Programming in Java 1.0.
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.
Using the while-statement to process data files. General procedure to access a data file General procedure in computer programming to read data from a.
© 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.
Peter Andreae Computer Science Victoria University of Wellington Copyright: Peter Andreae, Victoria University of Wellington Java Programs COMP 102 #3.
©2016 Pearson Education, Inc. Upper Saddle River, NJ. All Rights Reserved. CSC 110 – INTRO TO COMPUTING - PROGRAMMING Overview of Programming.
Simple algorithms on an array - compute sum and min.
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,
© Peter Andreae Java Programs COMP 102 # T1 Peter Andreae Computer Science Victoria University of Wellington.
The if-else statement. Introducing the if-else statement Programming problem: Re-write the a,b,c-formula program to solve for complex number solutions.
Execution ways of program References: www. en.wikipedia.org/wiki/Integrated_development_environment  You can execute or run a simple java program with.
Computer Science I Lab 1 ISMAIL ABUMUHFOUZ | CS 180.
Copyright © 2010 Pearson Education, Inc. Publishing as Pearson Addison-Wesley Chapter 1: Introduction to Computers and Programming.
Learning Plan 6 Java Programming Intro to Object Oriented Programming.
CS 201 Lecture 1 (b) Using an IDE Tarik Booker CS 201: Introduction to Programming California State University, Los Angeles.
Debuggers. Errors in Computer Code Errors in computer programs are commonly known as bugs. Three types of errors in computer programs –Syntax errors –Runtime.
Foundations of Programming: Java
Chapter 1 – Introduction
Exercise 1- I/O Write a Java program to input a value for mile and convert it to kilogram. 1 mile = 1.6 kg. import java.util.Scanner; public class MileToKg.
Chapter 3 GC 101 Java Fundamentals.
Compiling and Running a Java Program
Programming without BlueJ Week 12
Comp Sci 200 Programming I Jim Williams, PhD.
CS Programming I Jim Williams, PhD.
Something about Java Introduction to Problem Solving and Programming 1.
CS Week 4 Jim Williams, PhD.
Comp Sci 302 Introduction to Programming
CS Week 3 Jim Williams, PhD.
CS Week 3 Jim Williams.
CS 200 Primitives and Expressions
CS 200 Primitives and Expressions
Introduction to Java Brief history of Java Sample Java Program
Lecture Notes - Week 2 Lecture-1. Lecture Notes - Week 2 Lecture-1.
IB Computer Science II Paul Bui
CS Week 2 Jim Williams, PhD.
CS Programming I Jim Williams, PhD.
F II 2. Simple Java Programs Objectives
Ben Stanley for gAlpha gALPHA free, four-week venture-creation workshop designed to help entrepreneurially-minded students and technologists create high-growth.
Zorah Fung University of Washington, Winter 2016
Presentation transcript:

CS 200 - Programming I Jim Williams, PhD

Who Am I? My Interests: CS Education, specifically the teaching and learning of programming. PhD in Computer Science, minor in Educational Psychology Husband, Father, Coach, Traveller, ... http://pages.cs.wisc.edu/~jimw/

Comp Sci 200 - Programming I What is Computer Science & Programming? Tracing a Java Program Organization of Course Who is here? Programming Process

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.

A Java Program import java.util.Scanner; public class ReadNumber { public static void main(String[] args) { Scanner input = new Scanner(System.in); double num = input.nextDouble(); System.out.println("Number entered: " + num); } Java is a text language for controlling the computer. Programs are called "code" for a reason. Decode (read) "convert (a coded message) into intelligible language." [Google Dictionary]

Java Visualizer Demo Link available on right side of course website. https://cs200-www.cs.wisc.edu/wp/

https://cs200-www.cs.wisc.edu/wp/ http://pages.cs.wisc.edu/~cs200

Organization of Course: Study Cycle

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

Who is here?

Understand vs. Apply Steph Curry, NBA Golden State Warriors Basketball Analogy Demonstration vs. Practice Declarative Knowledge vs Procedural Knowledge Importance of Practice for learning If you watch the same video or even 10 different videos on how to shoot a basketball do you get better at shooting a basketball? Steph Curry, NBA Golden State Warriors

Declarative and Procedural Knowledge Declarative: Knowledge about something talk about a bike CS terms and Java syntax Procedural: Knowing how to do something ride a bike solve a problem systematically write in Java

Edit-Compile-Run Cycle From the command-line: notepad (Editor) javac (Compiler) java (Virtual Machine)

File name 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? Cat.class

Compile For the class named Cat, what command would compile the class? notepad Cat.java javac Cat.java java Cat.java java Cat For the class named Cat, what command would compile the class? javac Cat.java

Edit-Compile-Run Cycle Users Editor (Virtual) Machine Compiler Hello.java Hello.class Computer Files Programmer

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