UFCFY5-30-1Multimedia Studio Coding for Interactive Media Fundamental Concepts.

Slides:



Advertisements
Similar presentations
Java Planning our Programs Flowcharts Arithmetic Operators.
Advertisements

 2005 Pearson Education, Inc. All rights reserved Introduction.
1 Chapter 2 Introduction to Java Applications Introduction Java application programming Display ____________________ Obtain information from the.
Your First Java Program: HelloWorld.java
Chapter 2 - Introduction to Java Applications
CMT Programming Software Applications
Mathematical Operators  2000 Prentice Hall, Inc. All rights reserved. Modified for use with this course. Introduction to Computers and Programming in.
Introduction to Computers and Programming Lecture 3: Variables and Input Professor: Evan Korth New York University.
Java Intro. A First Java Program //The Hello, World! program in Java public class Hello { public static void main(String[] args) { System.out.println("Hello,
BASIC JAVA. Hello World n // Hello world program public class MyFirstJavaProgram { public static void main(String args[]) { char c = 'H'; String s =
School of Computing Science CMT1000 Ed Currie © Middlesex University Lecture 4: 1 CMT1000: Introduction to Programming Ed Currie Lecture 5a: Input and.
1 Data types, operations, and expressions Overview l Format of a Java Application l Primitive Data Types l Variable Declaration l Arithmetic Operations.
Java An introduction. Example 1 public class Example1 { public static void main (String [] args) { System.out.println (“This is the first example”); int.
Chapter 2 - Introduction to Java Applications
Fundamental Programming Structures in Java: Comments, Data Types, Variables, Assignments, Operators.
Moving To Code 3 More on the Problem-Solving Process §The final step in the problem-solving process is to evaluate and modify (if necessary) the program.
1 The First Step Learning objectives write Java programs that display text on the screen. distinguish between the eight built-in scalar types of Java;
Computer Programming Lab(4).
By: Mr. Baha Hanene Chapter 3. Learning Outcomes We will cover the learning outcome 02 in this chapter i.e. Use basic data-types and input / output in.
Hello AP Computer Science!. What are some of the things that you have used computers for?
Introduction to Programming Prof. Rommel Anthony Palomino Department of Computer Science and Information Technology Spring 2011.
Laboratory Study October, The very first example, traditional "Hello World!" program: public class first { public static void main (String[ ]
CS107 Introduction to Computer Science Java Basics.
C++ Basics Structure of a Program. C++ Source Code Plain text file Typical file extension .CPP Must compile the C++ source code without errors before.
Introduction to Programming David Goldschmidt, Ph.D. Computer Science The College of Saint Rose Java Fundamentals (Comments, Variables, etc.)
Java means Coffee Java Coffee Beans The name “JAVA” was taken from a cup of coffee.
9/6: Variable Types, Arithmetic Operators, Comparison Operators Addition.java in depth Variable types & data types Input from user: how to get it Arithmetic.
 2000 Prentice Hall, Inc. All rights reserved. 1 Chapter 2 - Introduction to Java Applications Outline 2.1Introduction 2.2A Simple Program: Printing a.
Using Data Within a Program Chapter 2.  Classes  Methods  Statements  Modifiers  Identifiers.
 Pearson Education, Inc. All rights reserved Introduction to Java Applications.
Jens Dalsgaard Nielsen Jan Dimon Bendtsen Dept. of Electronic Systems Basic Programming INS-basis GF, PDP and HST.
Programming for Beginners Martin Nelson Elizabeth FitzGerald Lecture 2: Variables & Data Types.
Programming Fundamentals 2: Simple/ F II Objectives – –give some simple examples of Java applications and one applet 2. Simple Java.
Variables and Math in Code. Variables A variable is a storage block for information in your program “A” “A” Computer Program Memory Computer Program.
1 Introduction to C# Programming Console applications No visual components Only text output Two types MS-DOS prompt - Used in Windows 95/98/ME Command.
College Board A.P. Computer Science A Topics Program Design - Read and understand a problem's description, purpose, and goals. Procedural Constructs -
1/28: Inputs, Variable Types, etc. Addition.java in depth Variable types & data types Input from user: how to get it Arithmetic operators.
CSC1030 HANDS-ON INTRODUCTION TO JAVA Introductory Lab.
ECE 122 Feb. 1, Introduction to Eclipse Java Statements Declaration Assignment Method calls.
VARIABLES Programmes work by manipulating data placed in memory. The data can be numbers, text, objects, pointers to other memory areas, and more besides.
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.
A Simple Java Program //This program prints Welcome to Java! public class Welcome { public static void main(String[] args) { public static void main(String[]
Chapter 2 Input, Variables and Data Types. JAVA Input JAVA input is not straightforward and is different depending on the JAVA environment that you are.
Component 4: Introduction to Information and Computer Science Unit 5: Overview of Programming Languages, Including Basic Programming Concepts Lecture 3.
JavaScript 1 COE 201- Computer Proficiency. Introduction JavaScript scripting language ▫Originally created by Netscape ▫Facilitates disciplined approach.
 2001 Prentice Hall, Inc. All rights reserved. 1 Chapter 3 – Introduction to C# Programming Outline 3.1 Introduction 3.2 Simple Program: Printing a Line.
Introduction to JavaScript CSc 2320 Fall 2014 Disclaimer: All words, pictures are adopted from “Simple JavaScript”by Kevin Yank and Cameron Adams and also.
THE DOUBLE VARIABLE The double variable can hold very large (or small) numbers. The maximum and minimum values are 17 followed by 307 zero’s.
CS001 Introduction to Programming Day 6 Sujana Jyothi
Computer Science A 1. Course plan Introduction to programming Basic concepts of typical programming languages. Tools: compiler, editor, integrated editor,
CS 106 Introduction to Computer Science I 01 / 24 / 2007 Instructor: Michael Eckmann.
UFCFY5-30-1Multimedia Studio Scripting for Interactive Media Using Interface Fields to Receive and Display Data to the User.
CCSA 221 Programming in C CHAPTER 3 COMPILING AND RUNNING YOUR FIRST PROGRAM 1 ALHANOUF ALAMR.
Input, Output and Variables GCSE Computer Science – Python.
Computer Programming Your First Java Program: HelloWorld.java.
Lecture 2 D&D Chapter 2 & Intro to Eclipse IDE Date.
2.5 Another Java Application: Adding Integers
Computer Programming Methodology Introduction to Java
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
Chapter 4 LOOPS © Bobby Hoggard, Department of Computer Science, East Carolina University / These slides may not be used or duplicated without permission.
Advanced Programming Lecture 02: Introduction to C# Apps
Chapter 2 - Introduction to Java Applications
Java Tutotrial for [NLP-AI] 2
Java Intro.
Chapter 3 – Introduction to C# Programming
7 – Variables, Input and Output
Introductory Java Programming
F II 2. Simple Java Programs Objectives
Presentation transcript:

UFCFY5-30-1Multimedia Studio Coding for Interactive Media Fundamental Concepts

UFCFY5-30-1Multimedia Studio Agenda Basic Process Variables and Data Types Assignment of Variables Output of Results and Formatting Coding Exercises.

UFCFY5-30-1Multimedia Studio Basic Computer Program Input Process Output.

UFCFY5-30-1Multimedia Studio Computer Program Steps Input (input the data) Process (process the data) Output (display the results).

UFCFY5-30-1Multimedia Studio Example: Program That Adds Two Numbers Input (first number, second number) Process (add numbers together) Output (display the results).

UFCFY5-30-1Multimedia Studio Example: Program Uses Numbers 10 and 5 Input (10,5) Process ( = 15) Output (15).

UFCFY5-30-1Multimedia Studio Variables and Types Need to declare variables to store data for the program Variables need to be of a particular data type program language data types can take many forms but the common ones are: integer (23, 345, 5, 0, -34) decimal (19.21, 0.001, 3.142, -0.64, 185.0) string (hello world, The Graduate, 007, 365 Days in a Year).

UFCFY5-30-1Multimedia Studio Java Data Types Java includes the following data types: int (for storing integer values) float (for storing decimal values) String (for storing string values).

UFCFY5-30-1Multimedia Studio Declaring Integer Variables in Java int firstNumber ; // stores first number variable name data type comment semi-colon statement ending double forward slash before single line comment

UFCFY5-30-1Multimedia Studio Decimal Type Declaration in Java float adecimalNumber; variable name type semi-colon statement ending

UFCFY5-30-1Multimedia Studio String Type Declaration in Java String aString; variable name type semi-colon statement ending

UFCFY5-30-1Multimedia Studio Declaring Variables in Java int firstNumber; // variable to store first number int secondNumber; //variable to store second number int addition; // variable to store the result of // adding the two numbers.

UFCFY5-30-1Multimedia Studio Assigning Values to Variables The process of storing a value into a variable is called assignment firstNumber = 10 variable assignment operator value

UFCFY5-30-1Multimedia Studio Assigning Values to Variables firstNumber = 10 ; // assigns 10 to first number secondNumber = 5; // assigns 5 to second number // add the numbers and store in addition variable addition = firstNumber + secondNumber ; The addition variable now holds the integer value 15

UFCFY5-30-1Multimedia Studio Declare & Assign Number Types float aDecimalNumber; // declare decimal variable aDecimalNumber = 5.34; // assign value

UFCFY5-30-1Multimedia Studio Declare & Assign String Types String myName; // declare string variable myName = “Barry Dean”; // assign value

UFCFY5-30-1Multimedia Studio A ‘Word’ on Comments // this is a single line comment /* this is a multi-line comment */

UFCFY5-30-1Multimedia Studio A Java Program public class HelloWorld { public static void main (String [] args){ System.out.println("Hello World"); }

UFCFY5-30-1Multimedia Studio A Java Program public class AddTwoNumbers { public static void main (String [] args){ int firstNumber = 5; int secondNUmber = 10; int total; total = ; System.out.println(total); }

UFCFY5-30-1Multimedia Studio Viewing Output of Data The simple form of program output is via the Console Window To output text or variable values you use System.out.println() with the output data included in the brackets: System.out.println(“Hello World”); // simple text output To output more than one data item you include each item in double quotes and use the + operator: System.out.println(“The sum of 10 and 5 is “ + addition); System.out.printl (myName + “ wrote this program.”);

UFCFY5-30-1Multimedia Studio Coding Examples & Tasks Follow the instructions in the worksheet provided to try out the example programs. Carry out the associated coding exercises.