CS Programming I: Programming Process

Similar documents
CS Programming I: Programming Process

CS Programming I: Programming Process

CS Programming I: Inheritance

CS Programming I: Arrays

CS Programming I: Exceptions

CS Programming I: Branches

CS Programming I: Exceptions

CS Programming I: ArrayList

CS Programming I: Branches

CS Programming I: Primitives and Expressions

CS Programming I: Classes

CS Programming I: Using Objects

CS Programming I: Using Objects

CS Programming I: File Input / Output

CS260 Intro to Java & Android 02.Java Technology

CS Programming I: File Input / Output

COMP 110/L Lecture 13. Kyle Dewey

Computer Programming-1 CSC 111. Chapter 1 : Introduction

Lesson 01 Introduction

Life Without NetBeans

Computing and compilers

Computers in Engineering COMP 208. Computer Structure. Computer Architecture. Computer Structure Michael A. Hawker

Introduction to Java. Lecture 1 COP 3252 Summer May 16, 2017

Instructions. First, download the file

CS2900 Introductory Programming with Python and C++ Kevin Squire LtCol Joel Young Fall 2007

Java: Comment Text. Introduction. Concepts

Lesson 04: Our First Java Program (W01D4

Lab # 2. For today s lab:

CS 11 java track: lecture 1

Java and C II. CSE 351 Spring Instructor: Ruth Anderson

Introduction. Computers, algorithms

COMP 322 / ELEC 323: Fundamentals of Parallel Programming

Command-line interface DOS Graphical User interface (GUI) -- Windows

Assoc. Prof. Dr. Marenglen Biba. (C) 2010 Pearson Education, Inc. All rights reserved.

I101/B100 Problem Solving with Computers

3 CREATING YOUR FIRST JAVA APPLICATION (USING WINDOWS)

What are different approaches of Computer Art? How can computation create art? 9/17/12. Human uses computer to modify digital images

CSC116: Introduction to Computing - Java

JVM interprets the Java bytecode, controls how it interacts with the operating system and manages memory.

Computer Architecture is...??? CSE 240A -- Principles of Computer Architecture. Computer Architecture is...??? Computer Architecture is...???

CSC116: Introduction to Computing - Java

CSC116: Introduction to Computing - Java

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 2: SEP. 8TH INSTRUCTOR: JIAYIN WANG

last time in cs recitations. computer commands. today s topics.

This calculation converts 3562 from base 10 to base 8 octal. Digits are produced right to left, so the final answer is 6752.

In this third unit about jobs in the Information Technology field we will speak about software development

These two items are all you'll need to write your first application reading instructions in English.

From Algorithms to Architecture....a lightning introduction to computer architecture

CLASSES AND OBJECTS. Summer 2018

Chapter 14 Abstract Classes and Interfaces

Welcome to the Primitives and Expressions Lab!

Professor Hugh C. Lauer CS-1004 Introduction to Programming for Non-Majors

What is a programming language?

Department of Civil and Environmental Engineering, Spring Semester, ENCE 688R: Midterm Exam: 1 1/2 Hours, Open Book and Open Notes

Certified Core Java Developer VS-1036

Java and Software Design

Introduction to Java Programming

Lecture 1. basic Python programs, defining functions

Nesting. Abstraction & Nesting. Example. if x is less than y output x is smaller else output y is smaller. CS256 Computer Science I Kevin Sahr, PhD

Elements of Computers and Programming Dr. William C. Bulko. What is a Computer?

Lecture 1: Introduction to Java

COMPUTER ENGINEERING PRE-ENGINEERING SUMMER Nayda G. Santiago Electrical and Computer Engineering Department, June 1, 2009

Course Wrap-up. CSC207 Fall 2015

Gaddis: Starting Out with Alice Test Bank Chapter Two 1 Chapter Two

C++ Spring Break Packet 11 The Java Programming Language

CS446: Machine Learning Fall Problem Set 4. Handed Out: October 17, 2013 Due: October 31 th, w T x i w

CS 177 Recitation. Week 1 Intro to Java

Formatted Output / User IO

A Quick Review of Chapter 1

Java Bytecode (binary file)

GETTING STARTED. The longest journey begins with a single step. In this chapter, you will learn about: Compiling and Running a Java Program Page 2

Welcome to. Instructor Marc Pomplun CS 470/670. Introduction to Artificial Intelligence 1/26/2016. Spring Selectivity in Complex Scenes

Agenda. CSE P 501 Compilers. Java Implementation Overview. JVM Architecture. JVM Runtime Data Areas (1) JVM Data Types. CSE P 501 Su04 T-1

COMP 250. Lecture 36 MISC. - beyond COMP final exam comments

CS/IT 114 Introduction to Java, Part 1 FALL 2016 CLASS 14: OCT. 25TH INSTRUCTOR: JIAYIN WANG

Administrativia. CS107 Introduction to Computer Science. Readings. Algorithms. Expressing algorithms

IT Introduction to Programming for I.T. Midterm Exam #1 - Prof. Reed Spring 2008

Review for Test 1 (Chapter 1-5)

Java Language. Programs. Computer programs, known as software, are instructions to the computer. You tell a computer what to do through programs.

Slide 1 Java Programming 1 Lecture 2D Java Mechanics Duration: 00:01:06 Advance mode: Auto

Programming 1. Lecture 1 COP 3014 Fall August 28, 2017

Eclipse. JVM, main method and using Eclipse. Dr. Siobhán Drohan. Produced by: Department of Computing and Mathematics

CS187 - Science Gateway Seminar for CS and Math

Supplementary Test 1

Lab 9: Creating a Reusable Class

CT 229. CT229 Lecture Notes. Labs. Tutorials. Lecture Notes. Programming II CT229. Objectives for CT229. IT Department NUI Galway

CHAPTER 2 PROBLEM SOLVING TECHNIQUES. Mr Mohd Hatta Bin Hj Mohamed Ali Computer Programming BFC2042

Week 2. CS 400 Programming III. Read: Module 2 readings before lecture

CS 116. Lab Assignment # 1 1

This paper is not to be removed from the Examination Halls UNIVERSITY OF LONDON

Lab Solutions: Experimenting with Enumerated Types

Chapter 1 Introduction to Computers, Programs, and Java

SKILL AREA 304: Review Programming Language Concept. Computer Programming (YPG)

COMP3221: Microprocessors and. Embedded Systems

More Complicated Recursion CMPSC 122

Getting Started with Eclipse/Java

Specifications and Modeling

COMP6700 Introductory Programming

Programming Languages and Techniques (CIS120)

IT151: Introduction to Programming (java)

Transcription:

CS 200 - Programming I: Programming Process Marc Renault Department of Computer Sciences University of Wisconsin Madison Fall 2017 TopHat Sec 3 (PM) Join Code: 719946 TopHat Sec 4 (AM) Join Code: 891624

Computational Thinking

1/14 Computer Science and Programming Computer Science Broad discipline that explores any and all areas of computation. Includes: theory of computation, algorithms, computer graphics, language theory, systems, and human-computer interaction. Programming Providing a set of instructions to a computer to automate a specific task or solve a given problem. An application of computer science. Implementing algorithms.

2/14 Problem Solving Art of Programming Abstraction Can you see the essential parts of the problem? What are the outputs? inputs? their relationship? Can you summerize the problem at a high level? What are the different components of the solution?

2/14 Problem Solving Art of Programming Abstraction Can you see the essential parts of the problem? What are the outputs? inputs? their relationship? Can you summerize the problem at a high level? What are the different components of the solution? Computational Thinking Think like a computer. What is the sequence of actions need to accomplish the task? Start with pseudocode.

3/14 Exercise Calculating the area and circumference of a circle. 1 What are the inputs? outputs? their relationship? 2 Pseudocode it! 3 Code it!

Computer

4/14 Basic Machine Architecture This is a computer. von Neumann Architecture von Neumann proposed this architecture in 1945. Consists of: a processing unit, memory, input devices, and output devices.

4/14 Basic Machine Architecture John von Neumann von Neumann Architecture von Neumann proposed this architecture in 1945. Consists of: a processing unit, memory, input devices, and output devices.

5/14 Basic View of a Computer Input Device Processor Output Device Memory

Explaining and Tracing

6/14 Explaining vs Tracing Explaining Summerize and provide a high-level explanation of what the code does in plain English.

6/14 Explaining vs Tracing Explaining Summerize and provide a high-level explanation of what the code does in plain English. Tracing Run the code as computer does. Put pen to paper. Write down the active variables and their values. Update them as they change as you mentally walk through the statements sequentially.

7/14 TopHat Q4 Explain the Circle.java code: a Calculates the area and the circumference of a circle. b Reads a radius as input from the user and outputs the the area and the circumference of the corresponding circle. c Creates a double variable called rad. Initializes it as 0. Prompts the user for a radius and stores it in rad. Outputs Area: ; calculates the area of a circle of radius rad and outputs it. Outputs Circumference: ; calculates the circumference of a circle of radius rad and outputs it.

8/14 Tool for Tracing Java Visualizer https://cscircles.cemc.uwaterloo.ca/java_visualize/

Edit-Compile-Run Cycle

9/14 Edit Writing some source code (set of instructions) in plain text. Editors Text Editors: vi

9/14 Edit Writing some source code (set of instructions) in plain text. Editors Text Editors: vi Integrated Development Environment (IDE):

10/14 Compile Build your code so that it can be run on a computer. Often compilers build an executable that can be run natively on the target platform.

10/14 Compile Build your code so that it can be run on a computer. Often compilers build an executable that can be run natively on the target platform. javac The Java compiler javac produces a bytecode file that needs to be run in a virtual machine.

10/14 Compile Build your code so that it can be run on a computer. Often compilers build an executable that can be run natively on the target platform. javac The Java compiler javac produces a bytecode file that needs to be run in a virtual machine. javac produces a bytecode file with a.class file extension.

10/14 Compile Build your code so that it can be run on a computer. Often compilers build an executable that can be run natively on the target platform. javac The Java compiler javac produces a bytecode file that needs to be run in a virtual machine. javac produces a bytecode file with a.class file extension. Example: javac Circle.java produces a Circle.class bytecode file.

11/14 Run Run or execute your code. java The.class bytecode file produced by javac needs to be run in the Java virtual machine.

11/14 Run Run or execute your code. java The.class bytecode file produced by javac needs to be run in the Java virtual machine. Example: java Circle runs the Circle file.

12/14 Virtual Machine The Classic Model: Native executable Source Code Compilation Machine Code (executable) The Java Model: Virtual Machine Source Code Compilation javac foo.java Bytecode foo.class Execution java foo Virtual Machine

13/14 Top Hat Q5 I have just written some Java code in a file SomeCode.java. How do I compile and run it? a. java SomeCode b. javac SomeCode.class c. javac SomeCode.java d. java SomeCode.java e. javac SomeCode f. java SomeCode.class

14/14 Further Reading COMP SCI 200: Programming I zybooks.com, 2015. zybook code: WISCCOMPSCI200Fall2017 Chapter 1. Programming Process

Appendix References Appendix

Appendix References References

Appendix References 15/14 Image Sources I http://www.eclipse.org/ https: //www.gnu.org/software/emacs/emacs.html http://packerville.blogspot.ca/2010/05/ gentlemen-this-is-football.html https: //en.wikipedia.org/wiki/microsoft_notepad http://2dvocabularynetwokr78.blogspot.fr/

Appendix References 16/14 Image Sources II http://www.lanl.gov/history/atomicbomb/ images/neumannl.gif https://brand.wisc.edu/web/logos/ https://commons.wikimedia.org/w/index.php? curid=1228427 https://commons. wikimedia.org/w/index.php?curid=57649239 http://www.zybooks.com/