March 2005 1R. Smith - University of St Thomas - Minnesota Today’s Class IntroductionsIntroductions About the CourseAbout the Course FundamentalsFundamentals.

Slides:



Advertisements
Similar presentations
AP Computer Science Anthony Keen. Computer 101 What happens when you turn a computer on? –BIOS tries to start a system loader –A system loader tries to.
Advertisements

Introduction to Programming G51PRG University of Nottingham Revision 1
CS0007: Introduction to Computer Programming Console Output, Variables, Literals, and Introduction to Type.
March R. Smith - University of St Thomas - Minnesota Today’s Class Quiz RecapQuiz Recap Exam ReviewExam Review C MaterialC Material Matlab MaterialMatlab.
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.
1 Chapter 2 Introduction to Java Applications Introduction Java application programming Display ____________________ Obtain information from the.
Object Oriented Programming in JAVA
Week 1 - Wednesday.  What did we talk about last time?  Syllabus  Computers.
March R. Smith - University of St Thomas - Minnesota Today’s Class Recap of a simple programRecap of a simple program A “history” of CA “history”
March /18R. Smith - University of St Thomas - Minnesota Today’s Class Recap - simple Java programRecap - simple Java program Simple types and printingSimple.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Hard Drives – more laterHard Drives – more later MethodsMethods.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Exam TopicsExam Topics.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class The project assignment, againThe project assignment, again Arrays.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Today: covering through P. 83 of textToday: covering through P. 83 of.
March R. Smith - University of St Thomas - Minnesota Today’s Class Course StuffCourse Stuff –Classroom change TOMORROW –Assignment; Lab While LoopsWhile.
Spring R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Final Exam ReviewFinal Exam Review –Assessment –Exam Format –C –Matlab.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Exam StatusExam Status Recap of Lab 7 ExampleRecap of Lab 7 Example.
Spring R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Return HomeworkReturn Homework Class ScheduleClass Schedule Functions:
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Exam ReviewExam Review Arithmetic - I think everyone gets thisArithmetic.
March /20R. Smith - University of St Thomas - Minnesota Today’s Class Recap - simple Java programRecap - simple Java program Revised history of JavaRevised.
C. About the Crash Course Cover sufficient C for simple programs: variables and statements control functions arrays and strings pointers Slides and captured.
Variables, Data Types, & Arithmetic Expressions CSC 1401: Introduction to Programming with Java Lecture 3 Wanda M. Kunkle.
March R. Smith - University of St Thomas - Minnesota ENGR 330: Today’s Class More “Clarifications” ?More “Clarifications” ? Interrupts – integrating.
6/28/2015 1R. Smith - University of St Thomas - Minnesota CISC 130: Today’s Class History Paper recapHistory Paper recap Finish the movieFinish the movie.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Data IndependenceData Independence Matlab #3: Exercise 5.1Matlab #3:
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class StatusStatus –Survey –Returning homework ArraysArrays –What are they?
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Finish up Lab 13Finish up Lab 13 Lab 14 – DetailsLab 14 – Details.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class About HomeworkAbout Homework Increment/DecrementIncrement/Decrement.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Homework & GradesHomework & Grades Multiple DimensionsMultiple Dimensions.
March R. Smith - University of St Thomas - Minnesota Today’s Class Homework NotesHomework Notes –Always try to match the printed output if I give.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class Change in order of topicsChange in order of topics –Starting Chapter.
March /18R. Smith - University of St Thomas - Minnesota QMCS 230: Today in Class The ExamThe Exam Homework NotesHomework Notes.
COMP 14: Primitive Data and Objects May 24, 2000 Nick Vallidis.
Copyright 2013 by Pearson Education Building Java Programs Chapter 1 Lecture 1-1: Introduction; Basic Java Programs reading:
Introducing Java.
Introduction to Programming Prof. Rommel Anthony Palomino Department of Computer Science and Information Technology Spring 2011.
COMP 110: Introduction to Programming Tyler Johnson January 14, 2009 MWF 11:00AM-12:15PM Sitterson 014.
March R. Smith - University of St Thomas - Minnesota Today’s Class IntroductionsIntroductions About the CourseAbout the Course FundamentalsFundamentals.
Introduction to Java Thanks to Dan Lunney (SHS). Java Basics File names The “main” method Output to screen Escape Sequence – Special Characters format()
Introduction to Programming David Goldschmidt, Ph.D. Computer Science The College of Saint Rose Java Fundamentals (Comments, Variables, etc.)
CSC204 – Programming I Lecture 4 August 28, 2002.
CS 11 java track: lecture 1 Administrivia need a CS cluster account cgi-bin/sysadmin/account_request.cgi need to know UNIX
Introduction to Computer Systems and the Java Programming Language.
Java means Coffee Java Coffee Beans The name “JAVA” was taken from a cup of coffee.
Chapter 2: Java Fundamentals
Object Oriented Programming Lecture 3. Introduction  In discussing Java, some items need to be clarified  The Java programming language  The Java virtual.
 Pearson Education, Inc. All rights reserved Introduction to Java Applications.
Introduction to programming in the Java programming language.
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 2: Variables & Data Types.
March R. Smith - University of St Thomas - Minnesota QMCS 130: Today’s Class Grades & Lab 12Grades & Lab 12 Upcoming ExamUpcoming Exam StructuresStructures.
JAVA Practical Creating our first program 2. Source code file 3. Class file 4. Understanding the different parts of our program 5. Escape characters.
1 WELCOME TO CIS 1068! Instructor: Alexander Yates.
Hello Computer Science!. Below is an example of a Hello World program in JAVA. While it is only three lines of code, there are many things that are happening.
Programming Fundamentals. Overview of Previous Lecture Phases of C++ Environment Program statement Vs Preprocessor directive Whitespaces Comments.
By Mr. Muhammad Pervez Akhtar
1/28/2016 1R. Smith - University of St Thomas - Minnesota CISC 130: Today’s Class Assignments 7 and 8Assignments 7 and 8 ExamExam History Paper AssignmentHistory.
2/22/2016 1R. Smith - University of St Thomas - Minnesota CISC 130: Today’s Class History Paper scheduleHistory Paper schedule RecapRecap Plus PlusPlus.
CS 106 Introduction to Computer Science I 09 / 10 / 2007 Instructor: Michael Eckmann.
CS 177 Recitation Week 1 – Intro to Java. Questions?
ITP 109 Week 2 Trina Gregory Introduction to Java.
CS 106 Introduction to Computer Science I 01 / 24 / 2007 Instructor: Michael Eckmann.
Introduction to 1. What is Java ? Sun Microsystems Java is a programming language and computing platform first released by Sun Microsystems in The.
Copyright 2010 by Pearson Education APCS Building Java Programs Chapter 1 Lecture 1-1: Introduction; Basic Java Programs reading:
7/6/2016 1R. Smith - University of St Thomas - Minnesota CISC 130: Today’s Class Collect PapersCollect Papers Review: Our ZeroesReview: Our Zeroes Review:
7/6/2016 1R. Smith - University of St Thomas - Minnesota CISC 130: Today’s Class Computer HardwareComputer Hardware Recap: next programRecap: next program.
Programming what is C++
Console Output, Variables, Literals, and Introduction to Type
Introduction to.
Unit 3: Variables in Java
CSE 142, Winter 2014 Building Java Programs Chapter 1
Presentation transcript:

March R. Smith - University of St Thomas - Minnesota Today’s Class IntroductionsIntroductions About the CourseAbout the Course FundamentalsFundamentals –Computer –Program - Sequence –Parts of a computer –Parts of a CPU Writing a really short programWriting a really short program HomeworkHomework

March R. Smith - University of St Thomas - Minnesota I love programming 20 year career, then went into something else20 year career, then went into something else My dad HATED programmingMy dad HATED programming My own kids never really tried itMy own kids never really tried it Some people will find they love itSome people will find they love it Some will hate it, and some are in the middleSome will hate it, and some are in the middle The GOAL: to be capable at programmingThe GOAL: to be capable at programming

March R. Smith - University of St Thomas - Minnesota Class Survey Who is sitting next to you?Who is sitting next to you? Their name? Major?Their name? Major? Why are they taking the course?Why are they taking the course? What computer skills do they bring to this class?What computer skills do they bring to this class?

March R. Smith - University of St Thomas - Minnesota Class Schedule I’ll arrive at 7:55 or so every dayI’ll arrive at 7:55 or so every day “Lectures” start at 8:15 AM, MW“Lectures” start at 8:15 AM, MW –Ends at 9:20 “Lab” starts at 8:00 AM Tue-Thu“Lab” starts at 8:00 AM Tue-Thu –Ends at 9:40 Both Lecture and Lab will start with a discussion of a new techniqueBoth Lecture and Lab will start with a discussion of a new technique

March R. Smith - University of St Thomas - Minnesota Syllabus Learning Java programmingLearning Java programming –The basic mechanics –Assignments and variables –Conditionals –Loops –Input/Output –Structure with multiple procedures –Arrays Lots and lots of programmingLots and lots of programming

March R. Smith - University of St Thomas - Minnesota How the class works Memorization and programmingMemorization and programming –This is lots and lots of detail work –You work fast if you work from memory –Practice and remember “patterns” that work Do the Reading!Do the Reading! –It gives you another source for programming details –A different way of describing the same stuff –A place to go to answer questions –“Some” problem sets based on the reading Quick Reference on end flapsQuick Reference on end flaps Labs = lists of programming tasks to doLabs = lists of programming tasks to do –Try to finish DURING lab –If you don’t, then you have extra homework

March R. Smith - University of St Thomas - Minnesota Fundamentals ComputerComputer Program - SequenceProgram - Sequence Parts of a computerParts of a computer –Note they are built hierarchically Parts of a CPUParts of a CPU

March R. Smith - University of St Thomas - Minnesota Java Program Always in a fileAlways in a file Starts with “public class”Starts with “public class” Usually contains a “public static void main”Usually contains a “public static void main” We “compile” it to make it workWe “compile” it to make it work

March R. Smith - University of St Thomas - Minnesota Sample Java Program public class hello { public static void main (String[] args) { System.out.println(“Hello, world!”); }}

March R. Smith - University of St Thomas - Minnesota Observations Case sensitive: match cases “exactly”Case sensitive: match cases “exactly” Program is worked “in order” from start to endProgram is worked “in order” from start to end –“Sequences” are fundamental to computing Curly braces mark “nested” componentsCurly braces mark “nested” components –“Hierarchies” are fundamental to computing Learn the “patterns” of typical programming tasksLearn the “patterns” of typical programming tasks –Setting up the program –Doing output

March R. Smith - University of St Thomas - Minnesota “Compiling” - the mechanics Should work the same on PCs and MacsShould work the same on PCs and Macs You have to “compile” programs to run themYou have to “compile” programs to run them $ javac hello.java $ You have to use the “JVM” to run them, tooYou have to use the “JVM” to run them, too $ java hello Hello, world! $

March R. Smith - University of St Thomas - Minnesota Homework 1.Read Chap. 1 & Chap. 2 Sec Find a “java compiler” on a computer you can use Already installed on 3rd and 4th floor OSSAlready installed on 3rd and 4th floor OSS May be installed on other campus computersMay be installed on other campus computers You can download it and install it at homeYou can download it and install it at home Java.sun.comJava.sun.com 3.Write a program that prints your name Ideally, use your U: drive or a USB driveIdeally, use your U: drive or a USB drive 4.Run it and print the result If it doesn’t work, write up a description of what you did and what happenedIf it doesn’t work, write up a description of what you did and what happened

March R. Smith - University of St Thomas - Minnesota What’s happening now? Revised history of JavaRevised history of Java Overview of Statements and VariablesOverview of Statements and Variables Simple typesSimple types Printing out textPrinting out text The nuts and bolts of compiling programsThe nuts and bolts of compiling programs

March R. Smith - University of St Thomas - Minnesota “My” History of Java Interpreting expressions (1940s)Interpreting expressions (1940s) Sort/Merge GeneratorSort/Merge Generator A2 CompilerA2 Compiler FortranFortran AlgolAlgol C Then, Objects happenedThen, Objects happened

March R. Smith - University of St Thomas - Minnesota Statements and Variables Statements we’ll useStatements we’ll use –“Wrappings” like class and static void Always followed by a pair of curly bracesAlways followed by a pair of curly braces –Other statements are followed by a “;” –Variable declarations –Assignment statements VariablesVariables –Storage cells in your program –Each one is like a spreadsheet cell, only dumber

March R. Smith - University of St Thomas - Minnesota Variable Naming Naming StructureNaming Structure First character: A-Z, a-z, _ or $First character: A-Z, a-z, _ or $ Remaining: same plus digitsRemaining: same plus digits Style rulesStyle rules Descriptive namesDescriptive names Usually start with lowercase letterUsually start with lowercase letter Camelback: use capitals to mark wordsCamelback: use capitals to mark words itemsOrdered, totalPaymentitemsOrdered, totalPayment DO NOT USE $ to start a nameDO NOT USE $ to start a name

March R. Smith - University of St Thomas - Minnesota “Types” of variables First use: you say the typeFirst use: you say the type int = “integer”int = “integer” signed, no decimal part, less than 2Gsigned, no decimal part, less than 2G String = character stringString = character string Usually captured in quotesUsually captured in quotes Note that “String” is capitalizedNote that “String” is capitalized ExamplesExamples int sampleInt = 12; sampleInt = 25; System.out.println(sampleInt);

March R. Smith - University of St Thomas - Minnesota Blanks, newlines, tabs System.out.printSystem.out.print System.out.printlnSystem.out.println “ ““ “ “Hello” + “ “ + “There”“Hello” + “ “ + “There” “Hello There”“Hello There” \n, \t\n, \t

March R. Smith - University of St Thomas - Minnesota Compiling and Running What is really happening?What is really happening? How a program executesHow a program executes Computer ‘Languages’Computer ‘Languages’ InterpetingInterpeting CompilingCompiling Byte codes, “virtual machines”Byte codes, “virtual machines” What it looks like in RAMWhat it looks like in RAM

March R. Smith - University of St Thomas - Minnesota Creative Commons License This work is licensed under the Creative Commons Attribution-Share Alike 3.0 United States License. To view a copy of this license, visit sa/3.0/us/ or send a letter to Creative Commons, 171 Second Street, Suite 300, San Francisco, California, 94105, USA.