JavaScript/ App Lab Programming:

Slides:



Advertisements
Similar presentations
Agenda Definitions Evolution of Programming Languages and Personal Computers The C Language.
Advertisements

 Suppose for a moment that you were asked to perform a task and were given the following list of instructions to perform:
CS0007: Introduction to Computer Programming Console Output, Variables, Literals, and Introduction to Type.
Creating a Program In today’s lesson we will look at: what programming is different types of programs how we create a program installing an IDE to get.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
Chapter 3 Planning Your Solution
Introduction To C++ Programming 1.0 Basic C++ Program Structure 2.0 Program Control 3.0 Array And Structures 4.0 Function 5.0 Pointer 6.0 Secure Programming.
Activity 1 - WBs 5 mins Go online and spend a moment trying to find out the difference between: HIGH LEVEL programming languages and LOW LEVEL programming.
© Curriculum Foundation1 Section 2 The nature of the assessment task Section 2 The nature of the assessment task There are three key questions: What are.
DCT 1123 PROBLEM SOLVING & ALGORITHMS INTRODUCTION TO PROGRAMMING.
CHAPTER 4: INTRODUCTION TO COMPUTER ORGANIZATION AND PROGRAMMING DESIGN Lec. Ghader Kurdi.
A First Program Using C#
Copyright ©: SAMSUNG & Samsung Hope for Youth. All rights reserved Tutorials Software: Building apps Suitable for: Advanced.
Introduction to Programming Lecture Number:. What is Programming Programming is to instruct the computer on what it has to do in a language that the computer.
CSE 351 GDB Introduction. Lab 1 Status? How is Lab 1 going? I’ll be available at the end of class to answer questions There are office hours later today.
Agenda Computer Languages How to Write a Simple C Program
The single most important skill for a computer programmer is problem solving Problem solving means the ability to formulate problems, think creatively.
JavaScript: API’s, Parameters and Creating Functions with Parameters
FOP: Multi-Screen Apps
AP CSP: Creating Functions & Top-Down Design
The Need for Algorithms
Creativity of Algorithms & Simple JavaScript Commands
Advanced Computer Systems
Component 1.6.
HTML Elements with JavaScript and DOM Events
Algorithms and Problem Solving
Regular Expressions 'RegEx'.
Vocabulary Algorithm - A precise sequence of instructions for processes that can be executed by a computer Low level programming language: A programming.
ENCODING AND SENDING FORMATTED TEXT
Topic: Programming Languages and their Evolution + Intro to Scratch
AP Computer Science Principles
Lecture 1 Introduction Richard Gesick.
Unit 5 Lesson 3: Introduction to Arrays
FOP: Buttons and Events
Unit 3 Lesson 4 & 5- Programming With Simple Commands / Creating Functions Day 26.
Functions and Top-Down Design
Lesson 5-2 AP Computer Science Principles
Unit 3 lesson 2&3 The Need For Algorithms- Creativity in Algorithms
Creativity in Algorithms
UNIT 3 – LESSON 5 Creating Functions.
The Need for Programming Languages
The Need for Algorithms 2 days
Looping and Random Numbers
Vocabulary Algorithm - A precise sequence of instructions for processes that can be executed by a computer.
Introduction CSE 1310 – Introduction to Computers and Programming
Meredith A. Henry, M.S. Department of Psychology
Intro to PHP & Variables
Teaching Computing to GCSE
TRANSLATORS AND IDEs Key Revision Points.
Teaching Computing to GCSE
CS190/295 Programming in Python for Life Sciences: Lecture 1
Functions Inputs Output
IPC144 Introduction to Programming Using C Week 1 – Lesson 2
Classes, Objects, and World-level Methods
Lesson 16: Functions with Return Values
UNIT 3 CHAPTER 1 LESSON 4 Using Simple Commands.
Looping and Random Numbers
Programming Basics - RobotC
1.1 The Characteristics of Contemporary Processors, Input, Output and Storage Devices Types of Processors.
Programming Languages
Algorithms and Problem Solving
Unit 3 lesson 2-5 The Need For Algorithms- Creativity in Algorithms – Simple Commands - Functions Day 18.
ICT Programming Lesson 1:
ICT Gaming Lesson 2.
U3L1 The Need For Programming
Review of Previous Lesson
U3L2 The Need For Algorithms
IPC144 Introduction to Programming Using C Week 2 – Lesson 2
WRITING AN ALGORITHM, PSEUDOCODE, AND FLOWCHART LESSON 2.
U3L4 Using Simple Commands
Presentation transcript:

JavaScript/ App Lab Programming: Simple JavaScript Commands and Creating Functions

Introduction to App Lab: So far the extent of our coding experience has been through web design. We have written HTML and CSS files to help us design some websites. Although we have written code, this type of coding isn’t wouldn’t be normally considered “real” programming. Today we are going to begin to learn to program and the language we are going to start with is JavaScript using the App Lab programming environment. JavaScript is a very important language especially since it is used for many websites. JavaScript can be used to make a website much more interactive. First we must learn some JavaScript code before we can apply it to websites. Using App Lab will teach you how to program in JavaScript by using a block language which allows for code to be created easily with very few compiling errors.

Using App Lab: Computers are machines. So if we invent an instruction or command for a computer to execute, then it should be unambiguous how the computer will interpret or attempt to execute that instruction. To use App Lab we are going to create an account on Code Studio and register for the class. Use the link below: http://studio.code.org/join/BDDRZM Once you are registered, Go to Unit 3 Stage 4 and begin completing all the parts in stage 4. Combine blocks together to sequence different pieces of code together. You are limited to four commands only for this exercise

Efficiency Discussion: What strategies or reasoning did you use to identify possible solutions? Is the solution that you or another group found the most efficient? How do you know? What does “efficiency” mean? “Efficiency” can mean different things depending on the context. When we try to create efficient programs, what other valuable resources might we be concerned about conserving?

Why limit to only 4 Commands? App Lab has much more than four basic commands, so why did the widget limit your ability? Collaborative problem-solving skills are important factors in programming. Being able to get together with other people to talk about and make reasoned arguments about the best ways to code things is what professionals do. Creativity You need to understand how to use the features of a programming language to solve a problem. You will always be constrained by the programming language.  The reason you need to learn how to program is because there isn’t a command to do every little thing; you have to understand the set of things that a programming language can do, and then use your creativity and problem-solving skills to get the computer to do what you want.

Function Transition: In the previous lesson we created simple turtle drawings using only four commands. At some point you probably wished that more commands were available to you. Describe a command you wanted to be able to use and explain why you wanted to use it. Think of commands you wish you had to complete the last task! Programming languages will always have some commands that are already defined, but there will be many instances when the exact command we want isn’t available. To add more functionality to our language we can create our own commands or functions. We’ve seen functions before in Java and now we are going to create our own functions to add more functionality to our programs.

Functions in JavaScript/App Lab We are going to transition back to App Lab and continue practicing your programming skills. You will still be limited to the four commands as before but that is all you will need to create the functions required. A Function is simply a sequence of commands that will be performed when that function called upon. For the most part we will be dealing with programs that follow a certain style when being created Camelcase : Multi-word function names are made a single word which begins in lowercase and uses uppercase letters to indicate the start of a new word. For example: thisFunctionNameIsCamelcase() **Function Definition at the Bottom : Function definitions appear at the bottom of the program. This is done so that the first line of the program is the first line of code actually run (Opposite format also common) Function Names Can’t Start with Numbers: In most programming languages, including JavaScript, function names are not allowed to begin with numbers or most symbols. Underscore, however, is allowed.

Creating Functions in App Lab: Go to Unit 3 Stage 5 and work on parts 2 – 8. You will be defining new functions from the four commands given to us which will allows us to use even more commands! Follow the prompts in the sections and complete all the tasks in Stage 5. Creating functions in JavaScript is somewhat similar to how it is done in Java, but it is a little easier to understand and create functions using App Lab.

Function Benefits: List the benefits of being able to define and call functions in a program. Who specifically gets to enjoy those benefits? Write this in your Do Now Journal

Function Benefits Answered: List the benefits of being able to define and call functions in a program. Who specifically gets to enjoy those benefits? programs are easier to read and write functions remove the need to repeat large chunks of code functions break the program into logical chunks The person programming and any other human reading the program enjoys these benefits. Important to note: functions do not make the program easier (or harder) for the computer to run or understand – it must still run all of the same commands as before.

App Lab Commands and Functions: Today we learned very simple JavaScript commands along with the basics of creating functions in JavaScript. We will continue to strengthen our knowledge of JavaScript commands in future lessons. We will expand on our knowledge of commands we have available to us along with learning how to create more advanced functions. Keep on practicing the tutorials on Code Studio so that you have a good understanding of what is going on.