Download presentation
Presentation is loading. Please wait.
1
Engineering Innovation Center
Intro to Programming Popup Course 2017
2
Intro to Programming Popup Course - Variables
Variables are used to store information to be referenced and used by programs An example of declaring and initializing a variable: Where ‘int’ is the variable type int x = 1; ‘x’ is the symbolic variable name And 1 is the value of the variable If we told our program to print ‘x’, what would happen? 1 would be printed. Think of variables as a bucket that can store stuff.
3
Intro to Programming Popup Course - Types
Variables are all required to have a type associated with it. This lets your program know what kind of data they expect to store/find. Some types require more or less memory space than others Some types are incompatible. You cannot store the character ‘a’ in a variable with and integer type. Common data types include: integers, booleans, characters, floating-point numbers, and alphanumeric strings
4
Intro to Programming Popup Course - Types
A whole number Float A floating point value (Number with decimals) Double A double-precision floating point value Char A single character String An array or list of chars Boolean A variable type that can only be either True or False Void A valueless special purpose type
5
Intro to Programming Popup Course - A Basic Data Structure
Array A collection/list of variables/values where each value has an index in the list associated with it
6
Intro to Programming Popup Course - Control Flow Statements - If statements
If statements are conditional checks used to conditionally alter the flow of the program. While the syntax may vary by programming languages, the basic structure is the same: If (conditional statement is true) { Do stuff } else if (other conditional statement is true) { Do other stuff. } else { Do other other stuff. The catch-all area. } The else-if portion is always optional while the else portion is usually optional
7
Intro to Programming Popup Course - Control Flow Statements – While Loop
A loop that runs while a given condition is true x = 0 while ( x < 10 ) { print x; x + 1; } This would print out the values 0 through 9.
8
Intro to Programming Popup Course - Control Flow Statements – For Loop
A syntactically different loop that runs while a given condition is true (initialization; condition; iteration) for ( x = 0; x < 10; x++ ) { print x; } This would also print out the values 0 through 9.
9
Intro to Programming Popup Course - Functions
A function is a subroutine, or a series of program instructions that perform a specific task. For example, you can have a function that adds any two things that is given to it: int myFunction(int x, int y) { return x + y; } print(myFunction(2,3)); // Prints “5” In this case, the function is called “myFunction” that takes two arguments and returns the integer sum of the given arguments.
10
Intro to Programming Popup Course - Python
Python is an interpreted programming language Uses whitespace indentation to delimit code blocks instead of curly brackets or keywords Supports, object-oriented, imperative, functional, and procedural programming paradigms
11
Intro to Programming Popup Course - C++
C++ is a compiled programming language Supports imperative, object-oriented, and generic programming paradigms while also providing low-level memory manipulation capabilities. A powerful and fast programming language if used correctly
12
Intro to Programming Popup Course - Java
Java is also a compiled programming language A general-purpose language that is concurrent, class-based, object-oriented, and generic Java is known for being cross-platform friendly.
13
Engineering Innovation Center
2017 – Jim Wilson
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.