An Extremely Short Introduction To Computer Programming

1y ago
6 Views
1 Downloads
917.92 KB
26 Pages
Last View : 1m ago
Last Download : 3m ago
Upload by : Evelyn Loftin
Transcription

An Extremely Short Introduction to Computer Programming Mike Scott 1

Who Am I? From St. Charles, Missouri Attended Stanford University 1986 - 1990 US Navy 1990 - 1998, Nuclear Submariner Married 1997 to Kelly, A US Navy Nurse Masters in CS, 1998, Rensselaer Polytechnic Institute, Troy, New York Out of Navy 1998 (both of us), moved to Austin to work for Motorola (Worst 10 weeks of my life) 2 years teaching CS at Round Rock High School 8 years as a lecturer here at UTCS department 2

Olivia and Isabelle 3

Computer Programming 4

Computer Science and Computer Programming There are many different fields of study in Computer Science Robotics Architecture Graphics Artificial Intelligence Systems And many, many more 5

Where Does Programming Fit in? "Having surveyed the relationships of computer science with other disciplines, it remains to answer the basic questions: What is the central core of the subject? What is it that distinguishes it from the separate subjects with which it is related? What is the linking thread which gathers these disparate branches into a single discipline? My answer to these questions is simple -- it is the art of programming a computer. It is the art of designing efficient and elegant methods of getting a computer to solve problems, theoretical or practical, small or large, simple or complex. It is the art of translating this design into an effective and accurate computer program." – C.A.R. Hoare, Essays in Computing Science Many different areas of Computer Science, computer programming is an important tool in almost all of those areas 6

Algorithms and Computer Programs Algorithm, a set of detailed, exact instructions, to carry out some task or solve some problem A computer program is the expression of an algorithm in a language a computer can understand A high level programming language is something that is used to implement an algorithm – suppose to be easy for humans to understand 7

Computer Programs You interact with computer programs all the time. Those programs were written by people. The computer didn't know how to do it until someone wrote the program 8

Programming Languages Many different programming languages – Java, C, C , Scheme, Haskell, Visual Basic, Perl, Python, Tcl/Tk, Pascal, Basic, Lisp, Prolog, Cobol, C#, Smalltalk, Eiffel, Fortran, Ada, Mathematica, MatLab, LabView These languages are divided into may different types – Object Oriented, Procedural, Functional, Graphical many different ways to solve a problem 9

What a Computer Does Programs must be converted into instructions the Central Processing Unit of a computer can understand The CPU carries out simple operations. Addition, subtraction, multiplication, division on numbers So what is the difference between a computer and a calculator? – The Big Difference is a computer can do calculations really fast Pentium 4 chip from 2001 can perform approximately 1,700,000,000 computations per second »If something can be represented numerically it can be stored on a computer and manipulated via the computer! pictures, images, video, music, text, DNA data, 10

Program Conversion high level programming languages are easier for humans to use a CPU understands a limited set of instructions expressed in binary, 1s and 0s the programs you write are translated or converted into a set of instructions the cpu can understand and carry out – this is done by another program called a compiler 11

Humans Smart, Computers Dumb Programming languages are just tools for writing programs No one best programming language LabVIEW - do a lot of interesting stuff very quickly Really good programmers know lots of languages and pick the right one for a particular task – part of solving the problem, how to frame the solution 12

Alice 13

What is Alice? Alice is a visual programming language. Alice is designed to teach someone how to program – It is not used in the "real world" the way Java or C is The output of Alice programs are movies. 14

Visual Programming Programming is done by pointing and clicking, dragging and dropping, selecting from menus, and some typing 15

Object Tree Details Panel World View Code Editor Event Editor Control Primitives 16

Alice Models Main programming data are 3d models Many built in and more on web 17

Output Output are 3d movies – run the program, play a movie – can also add sound to programs A lot easier to recognize logic errors – "Why do my ninja's arms keep flying away?" 18

Sample Program - Bunny and Broccoli 19

Sample Program Rolling a ball 20

Sample Program Finding Nemo – The charades scene Student interpretations 21

LabVIEW 22

LabView LabVIEW is a graphical programming language – as opposed to a text based programming language such as Java or C – originally developed to collect and analyze data from instrumentation. – can be used as a general purpose programming language There are similarities – – – – must think about what the problem is what is the program suppose to do? must plan a solution must implement and test the solution The difference is what you do when implementing solution. – typing vs. working with icons 23

LabView Program 24

Java Program (Partial) public void paintValue(Graphics g) { floath,s,b; intcol; Stringwks,outs; intred,green,blue; h (float)hValue; s (float)sValue; b (float)bValue; col Color.HSBtoRGB(h,s,b); g.setColor(new java.awt.Color(col)); g. fill3DRect(mainx, mainy mainh cy, mainw cx satw,cy*2, true); int wk col/256/256/256; col col - wk; red col/256/256; green (col-red*256*256)/256; blue col-red*256*256-green*256; wks Integer.toString(255 red,16); if (wks.length() 1) wks "0" wks; outs wks; wks Integer.toString(255 green,16); if (wks.length() 1) wks "0" wks; outs outs wks; wks Integer.toString(255 blue,16); if (wks.length() 1) wks "0" wks; outs outs wks; g.clearRect(0, mainy mainh cy*3, size().width, 35); g.setColor(Color.black); g.drawString("Color value " outs.toUpperCase(), mainx 5, mainy mainh cy*3 25); } 25

Result 26

getting a computer to solve problems, theoretical or practical, small or large, simple or complex. It is the art of translating this design into an effective and accurate computer program." - C.A.R. Hoare, Essays in Computing Science Many different areas of Computer Science, computer programming is an important tool in almost all of those .

Related Documents:

AUD & NZD USD, 'carry', EUR The latest IMM data covers the week from 2 April to 09 April 2019 Stretched short Neutral Stretched long Abs. position Positioning trend EUR Short JPY Short GBP Short CHF Short CAD Short AUD Short NZD Short MXN Long BRL Short RUB Long USD* Long *Adjusted according to USD value of contracts

work/products (Beading, Candles, Carving, Food Products, Soap, Weaving, etc.) ⃝I understand that if my work contains Indigenous visual representation that it is a reflection of the Indigenous culture of my native region. ⃝To the best of my knowledge, my work/products fall within Craft Council standards and expectations with respect to

4 WORKOUT A - UPPER BODY EXERCISE SETS REPS Pull Up 3 1-2 short of failure Push Up 13 -2 short of failure Inverted Row 3 1-2 short of failure Dip 3 1-2 short of failure Lateral Raise 3 1-2 short of failure One-Arm Shrug 2 per side 1-2 short of failure Biceps Curl 12 -2 short of failure Triceps Extension 2 1-2 short of failure Workout Notes:

Cold repetitive short-circuit test Short pulse -40 C, 10-ms pulse, cool down 100k Long pulse -40 C, 300-ms pulse, cool down 100k Hot repetitive short-circuit test 25 C, keeping short 100k 2.2.1 Cold Repetitive Short Circuit—Short Pulse This test must be performed for all devices with status feedback, and for latching devices even if they

hand Short-A and Long-A Short-A and Long-A Short-A and Long-A Short-A and Long-A Super Teacher Worksheets - www.superteacherworksheets.com. man Word Card 11 Scavenger Hunt . Find the short-a and long-a words in your classroom. Write the words on this page. Tell whether each word has the ă (short-a) or ā (long-a) sound

Decoding Fluency Drills Short a CVC words Short i CVC words Short o CVC words Short u CVC words Short e CVC words Diagraphs with short vowel sounds

B0100 . Short in D squib circuit . B0131 . Open in P/T squib (RH) circuit : B0101 . Open in D squib circuit : B0132 . Short in P/T squib (RH) circuit (to ground) B0102 . Short in D squib circuit (to ground) B0133 . Short in P/T squib (RH) circuit (to B ) B0103 . Short in D squib circuit (to B ) B0135 . Short in P/T

axiculus Lewis & Short 9 9 A small axle-tree Babilus Lewis & Short 5 5 an astronomer of the time of Nero babulus Lewis & Short 1 1 a babbler bacalusia Lewis & Short 1 1 a kind of sweetmeat baceolus Lewis & Short 0 0 [unavailable] baetulus Lewis & Short 1 1 a precious stone baiulus Elem. Lewis 0 0 a porter, carrier. bajulus