Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.

Programming Concepts

372 visualizaciones

Publicado el

Publicado en: Educación, Tecnología
  • Inicia sesión para ver los comentarios

  • Sé el primero en recomendar esto

Programming Concepts

  1. 1. PROGRAMMING CONCEPTS By Joshpal Sahota
  2. 2. INTRODUCTION • In this presentation I will be explaining the very basics of programming and will include the following programming concepts in my presentation:     SELECTION ITERATION DATA STRUCTURE FUNCTIONS, PARAMETERS AND/OR RETURN VALUES
  3. 3. TUTORIAL LESSON – PART 1 (SELECTION) IF ELSE STATEMENTS • An if statements can be used conjunctively with if else statements. • When the Boolean expression of an if statement is false, the if else statement will be executed. • Else if statements are incredibly useful when testing a number of conditions. • Else statements are use when none of the other conditions are true.
  4. 4. TUTORIAL LESSON – PART 1 (SELECTION)
  5. 5. TUTORIAL LESSON – PART 1 (SELECTION CONTINUED) SWITCH STATEMENTS • These are very similar to if statements, only it has many more conditions. • Switch statements tend to run faster than if statements. • They can be used with any numerical data type for example, char and int but not with text data types such as string.
  6. 6. TUTORIAL LESSON – PART 1 (SELECTION CONTINUED)
  7. 7. TUTORIAL LESSON – PART 2 (ITERATION) • The ultimate use of a loop is to repeat a block of code and is one of the most useful tasks in programming. • There are different types of loops, FOR loops are the most useful as they are an easy way of creating loops when the number of iterations are known.
  8. 8. TUTORIAL LESSON – PART 3 (DATA STRUCTURE) • When including structures we must use the struct keyword followed by the structure name. • The curly brackets after struct will declare the things that are contained within the structure. • Struct is only a definition for what the structure will look like and so you have to declare a structure in memory of the student type. We will call it stud. • In order to access the structure name and the sub item a „.‟ must be used between the two.
  9. 9. TUTORIAL LESSON – PART 3 (DATA STRUCTURE CONTINUED) • Arrays are a group of variables that uses one name instead of many. Individual variables are accessible by using a number. • To declare an array you must include square brackets after the name of the array. • The square brackets must include a number of variables/elements which are included within the array. • The number of arrays start from 0 (not 1) and can be displayed below the declaration of the array.
  10. 10. TUTORIAL LESSON – PART 4 • We use the code “#include <iostream>” which will allow us to print words on the screen. • The code “using namespace std;” will allow you to enter lines of code without having to write out the full code. • “int main() { }” The curly brackets show where the main function starts and ends. Every program must include a main function and the word „int‟ is to give an indication as to what the return value will be.
  11. 11. TUTORIAL LESSON – PART 4

×