How many objects can you create by drawing in the circles?

Slides:



Advertisements
Similar presentations
Slides modified by Erin Chambers Problem Solving and Algorithm Design.
Advertisements

11 Finding Winners Using Arrays Session 8.2. Session Overview  Find out how the C# language makes it easy to create an array that contains multiple values.
Chapter 10 Strings, Searches, Sorts, and Modifications Midterm Review By Ben Razon AP Computer Science Period 3.
Lesson aims To write a justified design specification for a specific product Lesson aims To write a justified design specification for a specific product.
Using Lists Games Programming in Scratch. Games Programming in Scratch Extension – Using Lists Learning Objectives Create a temporary data store (list)
M1G Introduction to Programming 2 3. Creating Classes: Room and Item.
Data Handling in Algorithms. Activity 1 Starter Task: Quickly complete the sheet 5mins!
Magic 8 ball. "Design and write a python program that emulates a Magic Eight Ball. Your program should continually prompt the user to enter a question.
Programming revision Revision tip: Focus on the things you find difficult first.
Arrays Chapter 7.
Starter What does the following code do?
Copyright 2013, 2010, 2007, 2005, Pearson, Education, Inc.
char first[10]="monkey"; char second[10]="fish"; char* keep;
Data Types and Structures
Regarding homework 9 Many low grades
Pseudocode Key Revision Points.
Outline lecture Revise arrays Entering into an array
Starter You have been asked to write a program to store the names of everybody in a class. Assuming there are 20 pupils in the class, how would you do.
IGCSE 4 Cambridge Data types and arrays Computer Science Section 2
FOP: JavaScript Arrays(Lists)
Now with a speaking professor! (hopefully...)
COMP 53 – Week Eleven Hashtables.
F453 Computing Questions and Answers
What to do when a test fails
Chapter 7 Part 1 Edited by JJ Shepherd
UNIT 3 – LESSON 5 Creating Functions.
Chapter 1: Data Structures 1A, B
Expertise and Memory Returning to educational psychology, we now discuss what distinguishes expertise from earlier stages of learning, how expertise can.
While Loops BIS1523 – Lecture 12.
Learning to Program in Python
CSc 110, Spring 2017 Lecture 19: more with lists
Graph Paper Programming
Learning to Program in Python
Learning to Program in Python
Python I/O.
Fill the screen challenge!
Starter 15//2 = 7 (Quotient or Floor) (Modulus) 22%3 =1
Databases Lesson 2.
LESSON 13 – INTRO TO ARRAYS
Learning to Program in Python
Data Structures – 1D Lists
Coding Concepts (Data Structures)
ARRAYS 1 GCSE COMPUTER SCIENCE.
Programming We have seen various examples of programming languages
Pointers.
Learning to Program in Python
Introduction To Databases GCSE Computer Science
Hello Year 7! Are you ready to create some spooooky scratch?
Starter answer these questions in your book
Learning Objectives Identify different types of event to start and stop loops Decompose a simple problem to help design a program Use abstraction to identify.
Learning Objectives Explain how selection is used to change a program output Decompose a problem with inputs to help design a program Describe the use.
Programming Control Structures with JavaScript Part 2
Why did the programmer quit his job?
ARRAYS 2 GCSE COMPUTER SCIENCE.
Introduction To Databases GCSE Computer Science
Seating “chart” Front Back 4 rows 5 rows 5 rows 4 rows 2 rows 2 rows
COMPUTATIONAL THINKING COMPUTATIONAL THINKING IN PROGRAMMING
Functions continued.
3 Chapter Chapter 2 Graphing.
Indices Practice L.O. All pupils are confident with their homework
Winter 2019 CISC101 5/26/2019 CISC101 Reminders
Starter Activities GCSE Python.
Arrays & Loops.
Arrays & Loops.
Year 8 Computer Science Digital Portfolio
Dictionary.
Python List.
Python Creating a calculator.
Presentation transcript:

How many objects can you create by drawing in the circles? Learning Objectives Explain how multiple data items are stored in an array Design algorithms to write to and read data from an array Explain the use of different types of array dependent on context Starter How many objects can you create by drawing in the circles?

Get Started! Learning Objectives Explain how multiple data items are stored in an array Design algorithms to write to and read data from an array Explain the use of different types of array dependent on context Get Started! Hand your sheet to the person next to you. Read out all of the items on your list (in order?) Did you remember them all? Were they in order? Which ones did you forget? Add a number [0],[1],[2]… each time your partner remembers an item correctly

Index Item Parrallel List Learning Objectives Explain how multiple data items are stored in an array Design algorithms to write to and read data from an array Explain the use of different types of array dependent on context Our Key Terms Index Array Item Parrallel List One Dimensional

What Is An Array? Array Learning Objectives Add this to your Glossary Explain how multiple data items are stored in an array Design algorithms to write to and read data from an array Explain the use of different types of array dependent on context What Is An Array? Add this to your Glossary Array “A data structure, similar to a variable that can hold more than one value of the same data type.”

We’ve removed 4 variables and replaced them with one array Learning Objectives Explain how multiple data items are stored in an array Design algorithms to write to and read data from an array Explain the use of different types of array dependent on context Data Abstraction? Abstraction is the removal of unnecessary detail to make a problem easier to solve. How is an array an abstraction? Image1 = “cat” Image 2 = “dog” Image3 = “dinner” Image4 = “ball” OR Images = [“cat”, “dog”, “dinner”, “ball”] We’ve removed 4 variables and replaced them with one array

Design your array Learning Objectives Explain how multiple data items are stored in an array Design algorithms to write to and read data from an array Explain the use of different types of array dependent on context Design your array In pseudocode, we use square brackets to identify an array. Add each of your objects to an array of strings using pseudocode. Hint: myObjects = [ ] myObjects = [“cat”, “puppy”, “breakfast”, “ball” ]

Code your array Learning Objectives Explain how multiple data items are stored in an array Design algorithms to write to and read data from an array Explain the use of different types of array dependent on context Code your array In python, we still use square brackets to identify an array. Add each of your objects to an array of strings using python and output them individually.

Code your array Learning Objectives Explain how multiple data items are stored in an array Design algorithms to write to and read data from an array Explain the use of different types of array dependent on context Code your array In python, we still use square brackets to identify an array. Add each of your objects to an array of strings using c# and output them individually.

mins 5 2 1 6 10 10 9 8 3 4 7 Get Programming! Learning Objectives Explain how multiple data items are stored in an array Design algorithms to write to and read data from an array Explain the use of different types of array dependent on context Get Programming! Now you designed your items and have seen how an array can be created, create your own array of programming terms. Add as many terms to your array as possible! How will you output your array? One by one, or at random? Comment your code to explain your choice 5 2 1 6 10 10 9 8 3 4 7 mins Time: 10 minutes total! (timer starts automatically)

The first item was overwritten, so the data was lost! Learning Objectives Explain how multiple data items are stored in an array Design algorithms to write to and read data from an array Explain the use of different types of array dependent on context Swapping Items Swapping items in an array is seen in sorting algorithms. What would the following code output? myObjects = [“cat”, “dog”, “dinner”, “ball”] myObjects[1] = myObjects[0] myObjects[0] = myObjects[1] OUTPUT myObjects The first item was overwritten, so the data was lost! [“cat”, “cat”, “dinner”, “ball”]

A temporary variable holds the item so they can be swapped Learning Objectives Explain how multiple data items are stored in an array Design algorithms to write to and read data from an array Explain the use of different types of array dependent on context Swapping Items Swapping items in an array is seen in sorting algorithms. How could we fix this? myObjects = [“cat”, “dog”, “dinner”, “ball”] myObjects[1] = myObjects[0] myObjects[0] = myObjects[1] OUTPUT myObjects temp = myObjects[0] myObjects[0] = myObjects[1] myObjects[1] = temp A temporary variable holds the item so they can be swapped

mins 5 2 1 6 10 10 9 8 3 4 7 Get Programming! Learning Objectives Explain how multiple data items are stored in an array Design algorithms to write to and read data from an array Explain the use of different types of array dependent on context Get Programming! Change your program to include the option for the user to swap the current term with the next term in the list. What will you do if the item is the last in the list? How will test if the items have been swapped? Comment your code to explain your choice 5 2 1 6 10 10 9 8 3 4 7 mins Time: 10 minutes total! (timer starts automatically)

mins 5 2 1 6 10 10 9 8 3 4 7 Arrays in Real Life Learning Objectives Explain how multiple data items are stored in an array Design algorithms to write to and read data from an array Explain the use of different types of array dependent on context Arrays in Real Life Investigate different places where you may need to store related data in a list. In pairs, make a list of as many places where this might be useful and the reasons why an array may or may not be appropriate. Array: “A data structure, similar to a variable that can hold more than one value of the same data type.” 5 2 1 6 10 10 9 8 3 4 7 mins Time: 10 minutes total! (timer starts automatically)

Learning Objectives Explain how multiple data items are stored in an array Design algorithms to write to and read data from an array Explain the use of different types of array dependent on context Homework Download and complete the Arrays revision placemat. Remember your notes should use: Well presented full sentences with Point, Explain, Example