Class01 Course Introduction MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 1/12/2016 Agenda • • • • • • Objectives of the course The Mechanics (grading) Value proposition of the course Hopes and dreams The approach we’ll take Getting started… Course Description In this course students will develop skills needed to solve real-world problems using cloud-based resources. This course aims to equip students with tools to help them translate prototypes into working products, and to prepare students for careers related to application development. Course Objectives Two broad objectives exist: 1. Provide supplemental information that was not feasible to present in MIS3501. 2. Give students the opportunity to create a working prototype application. The Mechanics Graded Materials • Exams (3) 60% • Project (1) 30% • Quizzes (8) 10% Exams will be multiple choice / short answer. Quizzes are intended to reinforce concepts learned in challenges, and also prepare you for the exams. The project will the primary measure of your technical skill. Value Proposition Founders of Top Unicorn Firms • Uber - Travis Kalanick (UCLA) Computer Engineering • PayPal, Tesla, SpaceX – Elon Musk (Penn, Stanford) Physics and Economics • AirBNB - Nathan Blecharczyk (Harvard) Computer Science • Palantir - Joe Lonsdale (Stanford) Computer Science Reflections of Former Students “Thanks for a great semester. I really enjoyed this class. I feel confident enough … that I can go out and actually make things … Without MIS3501 I would've been lost in this class.” – Andrew Crerand, student in MIS3502 last semester http://money.usnews.com/careers/best-jobs/computer-programmer/salary Hopes and Dreams Successful IT Career (thanks in part to your secret super-power) Successful IT Career (as a developer) Successful IT Career ( as an Innovator / Entrepreneur ) The approach we’ll take New tools Weeks 1-6 1. 2. 3. 4. 5. Using a web framework Weeks 7-9 Using a mobile device IDE Weeks 10-12 The class project (It’s a bake off!) Weeks 13-15 Arrays PDO MVC JavaScript / JSON RWD / CSS This class will be light on lecture, and heavy on exercises. Come to class ready to work, and ask questions. Getting Started It’s time for a gentle (re)introduction to arrays. Our objectives 1. Know what an array is. 2. Be able to create an array in PHP 3. Add, change, and delete data from an array. What is an array? An array is a data type that can contain one or more items called elements. Each element stores a value that you can refer to with an index. The length of the array indicates the number of elements that it contains. In short, an array is a structure that allows us to store multiple pieces of similar data. Creating an array The syntax for creating an array $array_name = array([value1[, value2, ... ]]) The syntax for referring to an element an array $array_name[index]; How to create an array of names With one statement $names = array('Ted Lewis', 'Sue Jones', 'Ray Thomas'); With multiple statements $names = array(); // create an empty array $names[0] = 'Ted Lewis'; // set 3 values in the array $names[1] = 'Sue Jones'; $names[2] = 'Ray Thomas'; Arrays can store any data type. How to create an array of discounts With one statement $discounts = array(0, 5, 10, 15); //these are integers With multiple statements $discounts = array(); // create an empty array $discounts[0] = 0; // set 4 values in the array $discounts[1] = 5; $discounts[2] = 10; $discounts[3] = 15; Arrays of undetermined length The syntax for adding an element to an array $array_name[] = $value; How to add a value to the end of an array $letters = array('a', 'b', 'c', 'd'); $letters[] = 'e'; // a, b, c, d // a, b, c, d, e Manipulating array contents How to set a value at a specific index $letters = array('a', 'b', 'c', 'd'); // a, b, c, d $letters[0] = 'e'; // e, b, c, d $letters[3] = 'f'; // e, b, c, f $letters[5] = 'g'; // e, b, c, f, NULL, g How to get values from an array $letters $letter1 $letter2 $letter4 = = = = array('a', 'b', 'c', 'd'); // a, b, c, d $letters[0]; // $letter1 is 'a' $letters[1]; // $letter2 is 'b' $letters[4]; // $letter4 is NULL Deleting Array Elements Functions for removing the values from elements unset($var1[, $var2 ...]) array_values($array) How to delete values from an array $letters = array('a', 'b', 'c', 'd'); // a, b, c, d unset($letters[2]); // a, b, NULL, d unset($letters); // $letters is NULL How to remove NULL elements and reindex $letters = array('a', 'b', 'c', 'd'); // a, b, c, d unset($letters[2]); // a, b, NULL, d $letters = array_values($letters); // a, b, d Let’s try an exercise