Programming In Any Language With “Hello, World!” Examples

Slides:



Advertisements
Similar presentations
Designing a Program & the Java Programming Language
Advertisements

Introducing JavaScript
1 COMM 1213 H1 COMP 4923 X1 JavaScript 1 (Readings: Ch. 10, 11 Knuckles)
1 CSC 551: Web Programming Spring 2004 client-side programming with JavaScript  scripts vs. programs  JavaScript vs. JScript vs. VBScript  common tasks.
The Web Warrior Guide to Web Design Technologies
Introduction to C Programming
Java Programming, 3e Concepts and Techniques Chapter 3 Manipulating Data Using Methods.
A Guide to Oracle9i1 Introduction To Forms Builder Chapter 5.
Tutorial 10 Programming with JavaScript
A Guide to Oracle9i1 Creating an Integrated Database Application Chapter 8.
XP Tutorial 1 New Perspectives on JavaScript, Comprehensive1 Introducing JavaScript Hiding Addresses from Spammers.
2012 •••••••••••••••••••••••••••••••••• Summer WorkShop Mostafa Badr
Introduction to JavaScript for Python Programmers
Visual Basic Fundamental Concepts. Integrated Development Enviroment Generates startup form for new project on which to place controls. Features toolbox.
Database-Driven Web Sites, Second Edition1 Chapter 8 Processing ASP.NET Web Forms and Working With Server Controls.
Scripting Languages.
WEEK 3 AND 4 USING CLIENT-SIDE SCRIPTS TO ENHANCE WEB APPLICATIONS.
What is Java Script? An extension to HTML. An extension to HTML. Allows authors to incorporate some functionality in their web pages. (without using CGI.
Javascript. Outline Introduction Fundamental of JavaScript Javascript events management DOM and Dynamic HTML (DHTML)
1 JavaScript in Context. Server-Side Programming.
XP Tutorial 10New Perspectives on Creating Web Pages with HTML, XHTML, and XML 1 Working with JavaScript Creating a Programmable Web Page for North Pole.
TUTORIAL 10: PROGRAMMING WITH JAVASCRIPT Session 2: What is JavaScript?
Tutorial 10 Programming with JavaScript. XP Objectives Learn the history of JavaScript Create a script element Understand basic JavaScript syntax Write.
Tutorial 10 Programming with JavaScript
Done by: Hanadi Muhsen1 Tutorial 1.  Learn the history of JavaScript  Create a script element  Write text to a Web page with JavaScript  Understand.
CS 11 java track: lecture 1 Administrivia need a CS cluster account cgi-bin/sysadmin/account_request.cgi need to know UNIX
Using Client-Side Scripts to Enhance Web Applications 1.
XP Tutorial 10New Perspectives on HTML and XHTML, Comprehensive 1 Working with JavaScript Creating a Programmable Web Page for North Pole Novelties Tutorial.
CS101: Introduction to Computer Science Slides adapted from Sedgewick and Wayne Copyright © Your First Java.
 2008 Pearson Education, Inc. All rights reserved JavaScript: Introduction to Scripting.
1 JavaScript in Context. Server-Side Programming.
Tutorial 10 Programming with JavaScript. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Learn the history of JavaScript.
Tutorial 10 Programming with JavaScript. 2New Perspectives on HTML, XHTML, and XML, Comprehensive, 3rd Edition Objectives Learn the history of JavaScript.
JavaScript and AJAX 2nd Edition Tutorial 1 Programming with JavaScript.
Chapter 4.  Variables – named memory location that stores a value.  Variables allows the use of meaningful names which makes the code easier to read.
1 Agenda  Unit 7: Introduction to Programming Using JavaScript T. Jumana Abu Shmais – AOU - Riyadh.
Visual Basic Fundamental Concepts
Information and Computer Sciences University of Hawaii, Manoa
Visual Basic.NET Windows Programming
A variable is a name for a value stored in memory.
Topics Introduction to Functions Defining and Calling a Void Function
Tutorial 10 Programming with JavaScript
Chapter 2 - Introduction to C Programming
2.5 Another Java Application: Adding Integers
The Selection Structure
Introduction to Scripting
CompSci 230 Software Construction
Chapter 2 - Introduction to C Programming
Variables and Arithmetic Operations
Visual Basic..
Chapter 2 - Introduction to C Programming
WEB PROGRAMMING JavaScript.
Use of Mathematics using Technology (Maltlab)
Introduction to JavaScript for Python Programmers
Chapter 2 - Introduction to C Programming
PHP.
T. Jumana Abu Shmais – AOU - Riyadh
Chapter 2 - Introduction to C Programming
Chapter 3 – Introduction to C# Programming
Tutorial 10 Programming with JavaScript
Understand the interaction between computer hardware and software
Tutorial 10: Programming with javascript
Chapter 2 - Introduction to C Programming
JavaScript: Introduction to Scripting
Apple Xcode with Swift Demo
Introduction to C Programming
Web Programming and Design
Intro to Programming (in JavaScript)
How to Run a Java Program
Presentation transcript:

Programming In Any Language With “Hello, World!” Examples Dr. C. Floyd Richmond frichmond@icloud.com This presentation could be presented in an hour, or can outline an entire course on any programming language.

Elements of All Programs Variables – Declarations, Numbers, Strings, Boolean, Reserved Words Math – Operations, Comparisons Commands and Functions - Syntax, Data Structures, Input and Output Program Flow - Control Structures, Mains, Subroutines, Conditionals, Objects – buttons, text fields, images, sounds, video, menus, dialogs, alerts, draw Events – keyboard, mouse, touchpad, path hiearchy Input and Output – files, parsing data Tools - Installation, Writing Code, Loading Libraries, Compiling/Running, Debugging Errors

Variables and Reserved Words Variables are symbols (usually a letter, word, or phrase) which are assigned a value by the programmer (examples: A=4, numRight=numRight+1). They are used for saving changeable information for later use (reports, etc.). Reserved words are usually letters, words or phrases defined by the programming language, so they are not available as variables (example (in some languages): pi = 3.1416).

Variables - Declarations Some languages require the declaration of the type and value of a variable before it is used. Others create them as needed. Variables may be . . . Global (apply to the entire program – like long-term memory) or Local (apply to only portions of the program – like short term memory).

Variables - Types Numbers Strings Booleans

Variables - Numbers Categories Integers Real Numbers Precision

Variables - Strings Categories Characters Text Length

Variables - Booleans Categories True (1) False (0) In some languages may be used as numbers (as indicated above)

Variables - Arrays Some programs support arrays of variables (similar to a column in a spreadsheet), and double arrays (similar to a spreadsheet), and triple and higher arrays (like a three dimensional spreadsheet – a cube).

Variables - Arrays The data itself will suggest whether it should be organized into arrays. These operations must be mastered for effective use. Array Creation Array Assignment Array Reference Array Index

Math Operations Comparisons

Math - Operations Addition (3+4=7) Parentheses and order of operations (3+4)*5-2=? Subtraction (7-5=2) Power (2^2=4) Multiplication (3*3=9) Roots (8^(1/3)=2) Division (9/3=3) Modular math (5mod2=1) Equal (assignment) Rounding Random

Math - Comparisons Equal AND Not Equal OR Greater than NOT Less Than Is subset Is true Is false

Commands and Functions Execute instructions with given parameters May return success or failure of operation Functions Execute calculations with given parameters Returns the value of the calculation

Commands and Functions Built-in User-Defined

Program Flow Program Flow Control Structures – Main and Subroutines Conditionals (If then else, while, onErr)

Objects Links Internal External Creating, reading and setting values

Objects Buttons Creating, reading and setting values Radio Buttons Checkboxes Popup Options Creating, reading and setting values

Objects Text Boxes Creating, reading and setting values Single line Multiple line Creating, reading and setting values

Objects Menus Submenus Creating, reading and setting values

Objects Dialogs Alerts Creating, reading and setting values

Objects Types: Images, Videos, Sounds Operations: Preloading, Loading, Checking, Playing, Pausing, Stopping, Locating points, Moving to points, Replacing, Sequencing, Linking Creating, reading and setting values

Objects Drawing shapes Creating, reading and setting values

Events - Input and Output Keyboard Mouse Touchscreen

Files - Input and Output Parsing Data Text: characters, words, items, paragraphs Numbers (rounding and precision)

Files - Input and Output Saving Data Save file locally Save file on a server Upload to a service Save cookies

Tools Installation Writing Code Libraries Compiling/Running Debugging/Errors

Hello World Javascript PHP Visual Basic Python Java

Hello World - JavaScript <html><body> <script> alert( 'Hello, World!' ); </script> </body> </html> Copy and paste this text into a text editor and save it as helloworld.html. Open the saved file with a browser.

Hello World - PHP <html><body>   <?php echo '<p>Hello, World!</p>'; ?>   </body></html> Copy and paste this text into a text editor and save it as helloworld.html. Open the saved file with a browser.

Hello World – VisualBasic Module Hello Sub Main() MsgBox("Hello, World!") End Sub  End Module Run VisualBasic in Windows. File>New Project. Copy and paste this code into the program area. Press play to run.

Hello World – Python print("Hello, World!") Run the terminal, type python, and at the prompt, type the command above and press return. Quit Python by typing quit and pressing return . . . OR . . . Copy and paste this text into a text editor and save it as helloworld.py. From the terminal, type python, then run ”helloworld.py” Quit Python by typing quit and pressing return.

Hello World – Java public class HelloWorld { } public static void main(String[] args) {System.out.println("Hello, World!"); } } Copy and paste this program into a text file, save it as helloworld.java. From the terminal, compile it by typing javac “helloworld.java” Execute it from the terminal by typing java helloworld.

Hello World – Swift (Apple iOS and OSX) labelText.text=“Hello, World!” Run Xcode and create single view application, click next, and save. Go to main.storyboard, create a label with no display name, Go to ViewController.swift, After “class ViewController: UIViewController {” . . . and before “}” . . . Control-drag from the label in the main.storyboard to the code area and name it labelText. Press return and enter the code above (labelText.text=“Hello, World!!”) Run as an iPhone or iPad app. For a similar but more sophisticated project see this link: Hello: https://youtu.be/HYQB_-YS6RE Calculator: https://youtu.be/AG2QDwmj64A Creating applications for OSX is exactly the same, but build for OSX instead.

Real World Examples By Floyd Richmond

Music Fundamentals Lessons http://floydrichmond.com/usetech/musicalflashcards/aaaindex.html

Saxophone Fingerings http://floydrichmond.com/classwork/annekramer/

Online Notation Proof of concept http://floydrichmond.com/notation

Programming In Any Language With “Hello, World!” Examples Dr. C. Floyd Richmond frichmond@icloud.com