1.1 java - Why Programming? 1.1 Your First Program...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
1.1 Your First Program 2 Why Programming? Idealized computer. "Please simulate the motion of a system of N heavenly bodies, subject to Newton's laws of motion and gravity." Prepackaged software solutions. Great, if it does exactly what you need. Computer programming. Art of making a computer do what you want. Ada Lovelace Analytic Engine 3 Languages Machine languages. Tedious and error-prone. Natural languages. Ambiguous and hard for computer to parse. High-level programming languages. Acceptable tradeoff. [ real newspaper headlines, compiled by Rich Pattis ] Kids Make Nutritious Snacks. Red Tape Holds Up New Bridge. Police Squad Helps Dog Bite Victim. Local High School Dropouts Cut in Half. “Instead of imagining that our main task is to instruct a computer what to do, let us concentrate rather on explaining to human beings what we want a computer to do.” – Donald Knuth 4 Why Java? Java features. ! Widely used. ! Widely available. ! Embraces full set of modern abstractions. ! Variety of automatic checks for mistakes in programs. Java economy. ! Mars rover. ! Cell phones. ! Blu-ray Disc. ! Web servers. ! Medical devices. ! Supercomputing. ! James Gosling http://java.net/jag $100 billion, 5 million developers
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
5 Why Java? Java features. ! Widely used. ! Widely available. ! Embraces full set of modern abstractions. ! Variety of automatic checks for mistakes in programs. Caveat. “There are only two kinds of programming languages: those people always [gripe] about and those nobody uses.” – Bjarne Stroustrup 6 Why Java? Java features. ! Widely used. ! Widely available. ! Embraces full set of modern abstractions. ! Variety of automatic checks for mistakes in programs. Caveat. No perfect language. Our approach. ! Minimal subset of Java. ! Develop general programming skills that are applicable to: C, C++, C#, Perl, Python, Ruby, Matlab, Fortran, Fortress, … 7 A Rich Subset of the Java Language Primitive Numeric Types != == >= <= < > -- / + % - ++ * Integer.parseInt() Double.parseDouble() Parsing Math.max() Math.min() Math.pow() Math.sqrt() Math.PI Math.abs() Math.log() Math.sin() Math Library Math.exp() Math.cos() System.out.println() System.out.print() System.out.printf() System for if Flow Control while else ! || true
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 10

1.1 java - Why Programming? 1.1 Your First Program...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online