Computer Programming I Module 13.2.1. This lesson illustrates how to code for arrays used to store data and how to display your data in listboxes.

Slides:



Advertisements
Similar presentations
Outline lecture Revise arrays Entering into an array
Advertisements

Programming with App Inventor Computing Institute for K-12 Teachers Summer 2012 Workshop.
Introduction to Arrays Chapter What is an array? An array is an ordered collection that stores many elements of the same type within one variable.
Lecture 13 Elements of Probability CSCI – 1900 Mathematics for Computer Science Fall 2014 Bill Pine.
Microsoft® Small Basic
Probability What are your Chances?
Synopsys University Courseware Copyright © 2012 Synopsys, Inc. All rights reserved. Compiler Optimization and Code Generation Lecture - 3 Developed By:
1. Probability of an Outcome 2. Experimental Probability 3. Fundamental Properties of Probabilities 4. Addition Principle 5. Inclusion-Exclusion Principle.
Comparing Exponential and Linear Functions Lesson 3.2.
Tonight’s JavaScript Topics 1 Conditional Statements: if and switch The Array Object Looping Statements: for, while and do-while.
A computer program which displays a blank screen or a moving image on the screen when the computer remains idle for a certain period of time. In the ‘Display.
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
Dice Games & Probabilities. Thermo & Stat Mech - Spring 2006 Class 16 Dice Games l One die has 6 faces. So, the probabilities associated with a dice game.
Probability – Page 1CSCI 1900 – Discrete Structures CSCI 1900 Discrete Structures Probability Reading: Kolman, Section 3.4.
1 A Balanced Introduction to Computer Science, 2/E David Reed, Creighton University ©2008 Pearson Prentice Hall ISBN Chapter 17 JavaScript.
Introduction to TouchDevelop
Emissions and Energy Reporting System How to use the Uncertainty Calculator with the Emissions and Energy Reporting System (EERS) This presentation works.
An Introduction to Programming with C++ Fifth Edition
Arrays (1) You create an array in LISP by using the function (make- array ). All elements are initially set to nil. To create a 1-dimensional array of.
VBA Modules, Functions, Variables, and Constants
JavaScript Events and Event Handlers 1 An event is an action that occurs within a Web browser or Web document. An event handler is a statement that tells.
Visual Basic Fundamental Concepts. Integrated Development Enviroment Generates startup form for new project on which to place controls. Features toolbox.
by Chris Brown under Prof. Susan Rodger Duke University June 2012
XP New Perspectives on Microsoft Office Access 2003 Tutorial 11 1 Microsoft Office Access 2003 Tutorial 11 – Using and Writing Visual Basic for Applications.
Programming with Alice Computing Institute for K-12 Teachers Summer 2011 Workshop.
MOM! Phineas and Ferb are … Aims:
How to: Hardy - Weinberg
ADVANCED EV3 PROGRAMMING LESSON
MIS 3200 – Unit 4.2 ListItem controls – CheckBoxList – ListBox.
6.3 List Boxes and Loops Some Properties, Methods, and Events of List Boxes List Boxes Populated with Strings List Boxes Populated with Numbers Searching.
Week 7. Lecture 2 Functions, Arrays, PHP&MySQL. Function with More than one argument and a return statement For a function to return a value, the return.
ME 142 Engineering Computation I Macros. Key Concepts Macro Overview Recording a Macro Running a Macro Editing a Macro.
Learning the skills for programming Advanced Visual Programming.
Computer Science 12 Mr. Jean May 2 nd, The plan: Video clip of the day Review of common errors in programs 2D Arrays.
Vectors and Matrices In MATLAB a vector can be defined as row vector or as a column vector. A vector of length n can be visualized as matrix of size 1xn.
WEEK #1: GETTING STARTED. COMMENCEMENT All material for Week #1 is under the “Week #1: Commencement” page. Most of the material is also duplicated under.
Arrays Arrays in C++ An array is a data structure which allows a collective name to be given to a group of elements which all have.
A Balanced Introduction to Computer Science, 3/E David Reed, Creighton University ©2011 Pearson Prentice Hall ISBN Chapter 17 JavaScript.
TOSS a Coin Toss a coin 50 times and record your results in a tally chart ht.
Chapter 6. Probability What is it? -the likelihood of a specific outcome occurring Why use it? -rather than constantly repeating experiments to make sure.
Introduction to C Programming Lecture 6. Functions – Call by value – Call by reference Arrays Today's Lecture Includes.
Select (drop-down list) Inputs. Insert/Form/List Menu.
Visual Basic for Application - Microsoft Access 2003 Programming applications using Objects.
1 One Dimensional Arrays Chapter 11 2 "All students to receive arrays!" reports Dr. Austin. Declaring arrays scores :
 In computer programming, a loop is a sequence of instruction s that is continually repeated until a certain condition is reached.  PHP Loops :  In.
COIT29222 Structured Programming 1 COIT29222-Structured Programming Lecture Week 02  Reading: Textbook(4 th Ed.), Chapter 2 Textbook (6 th Ed.), Chapters.
Programming with Microsoft Visual Basic 2008 Fourth Edition Chapter Ten Structures and Sequential Access Files.
+ Arrays & Random number generator. + Introduction In addition to arrays and structures, C supports creation and manipulation of the following data structures:
1D Arrays and Random Numbers Artem A. Lenskiy, PhD May 26, 2014.
Visual Basic.NET BASICS Lesson 11 List Boxes, For Next Loops, and Label Settings.
T U T O R I A L  2009 Pearson Education, Inc. All rights reserved Student Grades Application Introducing Two-Dimensional Arrays and RadioButton.
Experimental Probability Statistics and Probability.
1 Arrays of Arrays Quick review … arrays Arrays of arrays ≡ multidimensional array Example: times table Representation in memory Ragged arrays Example:
CS320n – Elements of Visual Programming Assignment Help Session.
Probability. Contents 1. Introduction to probability terminology 2. Probability models to compare relative frequency of events with theoretical probability.
Homework Questions. Simulations Unit 6 Experimental Estimates As the number of trials in an experiment increases, the relative frequency of an outcome.
1 Lesson 6 Introducing JavaScript HTML and JavaScript BASICS, 4 th Edition.
Visual Basic.NET Comprehensive Concepts and Techniques Chapter 5 Decision Making.
Probability What are your Chances? Warm Up Write each fraction in simplest form
Using Forms and Form Elements In Visual Basic.NET.
Probability. Today we will look at… 1.Quick Recap from last week 2.Terminology relating to events and outcomes 3.Use of sample spaces when dealing with.
Intro CS – Probability and Random Numbers Lesson Plan 6a.
Objective of the lesson Use Blockly to make a dice for Snakes and Ladders All of you will: – Make an image which displays when you press a button Most.
Dice Games & Probabilities
Index Section 1: Rolling a die Section 2: Master table 14:29.
Dice Games & Probabilities
Probability What are your Chances?
Learning Outcomes Tab (cont’d)
Mini Python Project Lesson 3.
Chapter 17 JavaScript Arrays
Presentation transcript:

Computer Programming I Module

This lesson illustrates how to code for arrays used to store data and how to display your data in listboxes.

Often, arrays are used to store data. Please review the following code: This program calculates the number of times the roll of a die generates a particular value. Out of 10,000 rolls, one die will have roughly equal outcomes for each number of 1 to 6.

The code statements keep track of the frequency of times each number is rolled by the following code:

Thus, each time the dice are rolled, the element in each index is increased by one. The following code displays the number of times each outcome is rolled:

 Interestingly enough, no matter how many sets of times you roll 10,000 times, the percentages will always remain relatively constant. Why is this? Well, it has to do with odds and percentages.  The code in the previous tab is just one example of how arrays are used in programs to store data. What would happen to the percentages if a pair of dice were thrown instead of just one? In an upcoming assignment, you will get the opportunity to find out!

List Boxes are used to display a list of items. In the previous example with the dice, the form has a List Box which shows the following information:

 This will display the elements created. Some of the more useful properties of a List Box:

 List Boxes also have methods that can be used by the programmer to accomplish certain tasks. Here are some of the more useful methods:

Click the box below and view the following video demonstration about Arrays and List Boxes.

Now, it is time for you to demonstrate your understanding of arrays and listboxes. Move on to Arrays and Listboxes Assignment Arrays and Listboxes Assignment