Second lecture on introductory programming for MzTEK. It covers arrays and primitive data types. It is assumed you are at least a little familiar with Processing.
The document discusses polymorphism and abstract classes in object-oriented programming. It describes how polymorphism allows one method name to have multiple implementations depending on the object type. Late binding associates the correct method implementation at runtime based on the actual object. The document also introduces abstract classes, which allow defining common methods but postponing their implementation to subclasses.
This document discusses data types and variables in JavaScript. It describes the main data types - integer, floating-point, boolean, and string. It explains that variables are used to store and manipulate data in memory, and have a name, type, and value. The document also covers declaring variables with the var keyword, assigning values to variables, and initializing variables before use.
First lecture on introductory programming for MzTEK. It covers basic workflow and primitive data types. It is assumed you are at least a little familiar with Processing and/or Arduino.
This document summarizes the design of an experiment to evaluate different music browsing and search interface parameters. The experiment will test how the number of concurrently playing songs, their musical similarity, and the presence of visualizations affect search and browsing task performance. Participants will complete timed search and browsing tasks using interfaces configured with different parameter settings. The goal is to determine the best interface configuration for presenting a small collection of songs to a user based on search and browsing task efficiency.
The document discusses creating and using functions in code. It explains that a function takes in input, performs some task, and can optionally output a return value. It provides examples of calling the size() function in Processing to set the window size, noting that size() has a return type of void so it doesn't directly output a value but instead performs the task of creating the window. The document emphasizes that functions allow you to reuse code without rewriting it, and discusses how functions fit into the flow of a program.
This workshop was given at FITC Toronto 2012. Most of the details were shared by browsing code and talking together, so there isn't very much "content" in the slides themselves.
The Nature of Code via Cinder - Modeling the Natural World in C++Nathan Koch
Modeling the natural world through Daniel Shiffman's book "The Nature of Code" - a look at the nature of animation and interaction as found in the natural world.
I use Cinder and C++ for my examples and explain why one would use those tools as opposed to say, Processing, or Flash.
The document discusses polymorphism and abstract classes in object-oriented programming. It describes how polymorphism allows one method name to have multiple implementations depending on the object type. Late binding associates the correct method implementation at runtime based on the actual object. The document also introduces abstract classes, which allow defining common methods but postponing their implementation to subclasses.
This document discusses data types and variables in JavaScript. It describes the main data types - integer, floating-point, boolean, and string. It explains that variables are used to store and manipulate data in memory, and have a name, type, and value. The document also covers declaring variables with the var keyword, assigning values to variables, and initializing variables before use.
First lecture on introductory programming for MzTEK. It covers basic workflow and primitive data types. It is assumed you are at least a little familiar with Processing and/or Arduino.
This document summarizes the design of an experiment to evaluate different music browsing and search interface parameters. The experiment will test how the number of concurrently playing songs, their musical similarity, and the presence of visualizations affect search and browsing task performance. Participants will complete timed search and browsing tasks using interfaces configured with different parameter settings. The goal is to determine the best interface configuration for presenting a small collection of songs to a user based on search and browsing task efficiency.
The document discusses creating and using functions in code. It explains that a function takes in input, performs some task, and can optionally output a return value. It provides examples of calling the size() function in Processing to set the window size, noting that size() has a return type of void so it doesn't directly output a value but instead performs the task of creating the window. The document emphasizes that functions allow you to reuse code without rewriting it, and discusses how functions fit into the flow of a program.
This workshop was given at FITC Toronto 2012. Most of the details were shared by browsing code and talking together, so there isn't very much "content" in the slides themselves.
The Nature of Code via Cinder - Modeling the Natural World in C++Nathan Koch
Modeling the natural world through Daniel Shiffman's book "The Nature of Code" - a look at the nature of animation and interaction as found in the natural world.
I use Cinder and C++ for my examples and explain why one would use those tools as opposed to say, Processing, or Flash.
Variables are used to store information in C# and are labeled with a name. There are different variable types like string, bool, float, and int. Variables must be declared with the type and name. Common variable types in games include player, transform, animator, and float for things like score and health. Challenges involve creating variables of different types for items, calculating tips, and averaging quiz grades. Additional practice resources are provided.
For More :
https://www.facebook.com/Computer-Programming-Assignments-826290177441561/
-
https://www.facebook.com/A-Tech-and-Software-Development-1683037138630673/
This document provides an overview of pointers and memory allocation in C++. It discusses four main areas of memory allocation: code, static, stack, and heap. Code and static memory are allocated at compile time based on variable declarations. Stack memory is allocated dynamically when functions are called to store local variables and function parameters. Heap memory is allocated dynamically at runtime using new to store dynamically allocated objects, like those in vectors, whose size is not known at compile time. Pointers allow accessing and modifying dynamically allocated memory that persists outside the current stack frame.
This document discusses data types and variables in C++. It covers fundamental/built-in data types like int, float, char, and bool. It also discusses derived/user-defined types like arrays and structures. It explains how to declare and initialize variables, specifying the data type and assigning a value. Variables are containers that store data in memory locations, with each data type taking up a certain number of bytes.
This document discusses Java data types and variables. It defines variables as containers that hold data values and notes there are three types: local, instance, and static. Local variables are declared within methods while instance variables are declared in a class but outside methods. Static variables can be accessed by the class name. The document also outlines Java's primitive data types like int and double, and non-primitive types like Strings and Arrays. It explains type casting between primitive types and differences between primitive and non-primitive data types.
This document discusses variables and fundamental data types in C programming. It explains that variables are used to store temporary values during program execution and must be declared before use. It also covers the different fundamental data types like int, char, float, and double, and how they are represented and used. Integer, floating point, and character constants are also explained.
This presentation includes basic of PCOS their pathology and treatment and also Ayurveda correlation of PCOS and Ayurvedic line of treatment mentioned in classics.
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPRAHUL
This Dissertation explores the particular circumstances of Mirzapur, a region located in the
core of India. Mirzapur, with its varied terrains and abundant biodiversity, offers an optimal
environment for investigating the changes in vegetation cover dynamics. Our study utilizes
advanced technologies such as GIS (Geographic Information Systems) and Remote sensing to
analyze the transformations that have taken place over the course of a decade.
The complex relationship between human activities and the environment has been the focus
of extensive research and worry. As the global community grapples with swift urbanization,
population expansion, and economic progress, the effects on natural ecosystems are becoming
more evident. A crucial element of this impact is the alteration of vegetation cover, which plays a
significant role in maintaining the ecological equilibrium of our planet.Land serves as the foundation for all human activities and provides the necessary materials for
these activities. As the most crucial natural resource, its utilization by humans results in different
'Land uses,' which are determined by both human activities and the physical characteristics of the
land.
The utilization of land is impacted by human needs and environmental factors. In countries
like India, rapid population growth and the emphasis on extensive resource exploitation can lead
to significant land degradation, adversely affecting the region's land cover.
Therefore, human intervention has significantly influenced land use patterns over many
centuries, evolving its structure over time and space. In the present era, these changes have
accelerated due to factors such as agriculture and urbanization. Information regarding land use and
cover is essential for various planning and management tasks related to the Earth's surface,
providing crucial environmental data for scientific, resource management, policy purposes, and
diverse human activities.
Accurate understanding of land use and cover is imperative for the development planning
of any area. Consequently, a wide range of professionals, including earth system scientists, land
and water managers, and urban planners, are interested in obtaining data on land use and cover
changes, conversion trends, and other related patterns. The spatial dimensions of land use and
cover support policymakers and scientists in making well-informed decisions, as alterations in
these patterns indicate shifts in economic and social conditions. Monitoring such changes with the
help of Advanced technologies like Remote Sensing and Geographic Information Systems is
crucial for coordinated efforts across different administrative levels. Advanced technologies like
Remote Sensing and Geographic Information Systems
9
Changes in vegetation cover refer to variations in the distribution, composition, and overall
structure of plant communities across different temporal and spatial scales. These changes can
occur natural.
How to Manage Your Lost Opportunities in Odoo 17 CRMCeline George
Odoo 17 CRM allows us to track why we lose sales opportunities with "Lost Reasons." This helps analyze our sales process and identify areas for improvement. Here's how to configure lost reasons in Odoo 17 CRM
How to Build a Module in Odoo 17 Using the Scaffold MethodCeline George
Odoo provides an option for creating a module by using a single line command. By using this command the user can make a whole structure of a module. It is very easy for a beginner to make a module. There is no need to make each file manually. This slide will show how to create a module using the scaffold method.
Walmart Business+ and Spark Good for Nonprofits.pdfTechSoup
"Learn about all the ways Walmart supports nonprofit organizations.
You will hear from Liz Willett, the Head of Nonprofits, and hear about what Walmart is doing to help nonprofits, including Walmart Business and Spark Good. Walmart Business+ is a new offer for nonprofits that offers discounts and also streamlines nonprofits order and expense tracking, saving time and money.
The webinar may also give some examples on how nonprofits can best leverage Walmart Business+.
The event will cover the following::
Walmart Business + (https://business.walmart.com/plus) is a new shopping experience for nonprofits, schools, and local business customers that connects an exclusive online shopping experience to stores. Benefits include free delivery and shipping, a 'Spend Analytics” feature, special discounts, deals and tax-exempt shopping.
Special TechSoup offer for a free 180 days membership, and up to $150 in discounts on eligible orders.
Spark Good (walmart.com/sparkgood) is a charitable platform that enables nonprofits to receive donations directly from customers and associates.
Answers about how you can do more with Walmart!"
हिंदी वर्णमाला पीपीटी, hindi alphabet PPT presentation, hindi varnamala PPT, Hindi Varnamala pdf, हिंदी स्वर, हिंदी व्यंजन, sikhiye hindi varnmala, dr. mulla adam ali, hindi language and literature, hindi alphabet with drawing, hindi alphabet pdf, hindi varnamala for childrens, hindi language, hindi varnamala practice for kids, https://www.drmullaadamali.com
বাংলাদেশের অর্থনৈতিক সমীক্ষা ২০২৪ [Bangladesh Economic Review 2024 Bangla.pdf] কম্পিউটার , ট্যাব ও স্মার্ট ফোন ভার্সন সহ সম্পূর্ণ বাংলা ই-বুক বা pdf বই " সুচিপত্র ...বুকমার্ক মেনু 🔖 ও হাইপার লিংক মেনু 📝👆 যুক্ত ..
আমাদের সবার জন্য খুব খুব গুরুত্বপূর্ণ একটি বই ..বিসিএস, ব্যাংক, ইউনিভার্সিটি ভর্তি ও যে কোন প্রতিযোগিতা মূলক পরীক্ষার জন্য এর খুব ইম্পরট্যান্ট একটি বিষয় ...তাছাড়া বাংলাদেশের সাম্প্রতিক যে কোন ডাটা বা তথ্য এই বইতে পাবেন ...
তাই একজন নাগরিক হিসাবে এই তথ্য গুলো আপনার জানা প্রয়োজন ...।
বিসিএস ও ব্যাংক এর লিখিত পরীক্ষা ...+এছাড়া মাধ্যমিক ও উচ্চমাধ্যমিকের স্টুডেন্টদের জন্য অনেক কাজে আসবে ...
Leveraging Generative AI to Drive Nonprofit InnovationTechSoup
In this webinar, participants learned how to utilize Generative AI to streamline operations and elevate member engagement. Amazon Web Service experts provided a customer specific use cases and dived into low/no-code tools that are quick and easy to deploy through Amazon Web Service (AWS.)
Chapter wise All Notes of First year Basic Civil Engineering.pptxDenish Jangid
Chapter wise All Notes of First year Basic Civil Engineering
Syllabus
Chapter-1
Introduction to objective, scope and outcome the subject
Chapter 2
Introduction: Scope and Specialization of Civil Engineering, Role of civil Engineer in Society, Impact of infrastructural development on economy of country.
Chapter 3
Surveying: Object Principles & Types of Surveying; Site Plans, Plans & Maps; Scales & Unit of different Measurements.
Linear Measurements: Instruments used. Linear Measurement by Tape, Ranging out Survey Lines and overcoming Obstructions; Measurements on sloping ground; Tape corrections, conventional symbols. Angular Measurements: Instruments used; Introduction to Compass Surveying, Bearings and Longitude & Latitude of a Line, Introduction to total station.
Levelling: Instrument used Object of levelling, Methods of levelling in brief, and Contour maps.
Chapter 4
Buildings: Selection of site for Buildings, Layout of Building Plan, Types of buildings, Plinth area, carpet area, floor space index, Introduction to building byelaws, concept of sun light & ventilation. Components of Buildings & their functions, Basic concept of R.C.C., Introduction to types of foundation
Chapter 5
Transportation: Introduction to Transportation Engineering; Traffic and Road Safety: Types and Characteristics of Various Modes of Transportation; Various Road Traffic Signs, Causes of Accidents and Road Safety Measures.
Chapter 6
Environmental Engineering: Environmental Pollution, Environmental Acts and Regulations, Functional Concepts of Ecology, Basics of Species, Biodiversity, Ecosystem, Hydrological Cycle; Chemical Cycles: Carbon, Nitrogen & Phosphorus; Energy Flow in Ecosystems.
Water Pollution: Water Quality standards, Introduction to Treatment & Disposal of Waste Water. Reuse and Saving of Water, Rain Water Harvesting. Solid Waste Management: Classification of Solid Waste, Collection, Transportation and Disposal of Solid. Recycling of Solid Waste: Energy Recovery, Sanitary Landfill, On-Site Sanitation. Air & Noise Pollution: Primary and Secondary air pollutants, Harmful effects of Air Pollution, Control of Air Pollution. . Noise Pollution Harmful Effects of noise pollution, control of noise pollution, Global warming & Climate Change, Ozone depletion, Greenhouse effect
Text Books:
1. Palancharmy, Basic Civil Engineering, McGraw Hill publishers.
2. Satheesh Gopi, Basic Civil Engineering, Pearson Publishers.
3. Ketki Rangwala Dalal, Essentials of Civil Engineering, Charotar Publishing House.
4. BCP, Surveying volume 1
Variables are used to store information in C# and are labeled with a name. There are different variable types like string, bool, float, and int. Variables must be declared with the type and name. Common variable types in games include player, transform, animator, and float for things like score and health. Challenges involve creating variables of different types for items, calculating tips, and averaging quiz grades. Additional practice resources are provided.
For More :
https://www.facebook.com/Computer-Programming-Assignments-826290177441561/
-
https://www.facebook.com/A-Tech-and-Software-Development-1683037138630673/
This document provides an overview of pointers and memory allocation in C++. It discusses four main areas of memory allocation: code, static, stack, and heap. Code and static memory are allocated at compile time based on variable declarations. Stack memory is allocated dynamically when functions are called to store local variables and function parameters. Heap memory is allocated dynamically at runtime using new to store dynamically allocated objects, like those in vectors, whose size is not known at compile time. Pointers allow accessing and modifying dynamically allocated memory that persists outside the current stack frame.
This document discusses data types and variables in C++. It covers fundamental/built-in data types like int, float, char, and bool. It also discusses derived/user-defined types like arrays and structures. It explains how to declare and initialize variables, specifying the data type and assigning a value. Variables are containers that store data in memory locations, with each data type taking up a certain number of bytes.
This document discusses Java data types and variables. It defines variables as containers that hold data values and notes there are three types: local, instance, and static. Local variables are declared within methods while instance variables are declared in a class but outside methods. Static variables can be accessed by the class name. The document also outlines Java's primitive data types like int and double, and non-primitive types like Strings and Arrays. It explains type casting between primitive types and differences between primitive and non-primitive data types.
This document discusses variables and fundamental data types in C programming. It explains that variables are used to store temporary values during program execution and must be declared before use. It also covers the different fundamental data types like int, char, float, and double, and how they are represented and used. Integer, floating point, and character constants are also explained.
This presentation includes basic of PCOS their pathology and treatment and also Ayurveda correlation of PCOS and Ayurvedic line of treatment mentioned in classics.
LAND USE LAND COVER AND NDVI OF MIRZAPUR DISTRICT, UPRAHUL
This Dissertation explores the particular circumstances of Mirzapur, a region located in the
core of India. Mirzapur, with its varied terrains and abundant biodiversity, offers an optimal
environment for investigating the changes in vegetation cover dynamics. Our study utilizes
advanced technologies such as GIS (Geographic Information Systems) and Remote sensing to
analyze the transformations that have taken place over the course of a decade.
The complex relationship between human activities and the environment has been the focus
of extensive research and worry. As the global community grapples with swift urbanization,
population expansion, and economic progress, the effects on natural ecosystems are becoming
more evident. A crucial element of this impact is the alteration of vegetation cover, which plays a
significant role in maintaining the ecological equilibrium of our planet.Land serves as the foundation for all human activities and provides the necessary materials for
these activities. As the most crucial natural resource, its utilization by humans results in different
'Land uses,' which are determined by both human activities and the physical characteristics of the
land.
The utilization of land is impacted by human needs and environmental factors. In countries
like India, rapid population growth and the emphasis on extensive resource exploitation can lead
to significant land degradation, adversely affecting the region's land cover.
Therefore, human intervention has significantly influenced land use patterns over many
centuries, evolving its structure over time and space. In the present era, these changes have
accelerated due to factors such as agriculture and urbanization. Information regarding land use and
cover is essential for various planning and management tasks related to the Earth's surface,
providing crucial environmental data for scientific, resource management, policy purposes, and
diverse human activities.
Accurate understanding of land use and cover is imperative for the development planning
of any area. Consequently, a wide range of professionals, including earth system scientists, land
and water managers, and urban planners, are interested in obtaining data on land use and cover
changes, conversion trends, and other related patterns. The spatial dimensions of land use and
cover support policymakers and scientists in making well-informed decisions, as alterations in
these patterns indicate shifts in economic and social conditions. Monitoring such changes with the
help of Advanced technologies like Remote Sensing and Geographic Information Systems is
crucial for coordinated efforts across different administrative levels. Advanced technologies like
Remote Sensing and Geographic Information Systems
9
Changes in vegetation cover refer to variations in the distribution, composition, and overall
structure of plant communities across different temporal and spatial scales. These changes can
occur natural.
How to Manage Your Lost Opportunities in Odoo 17 CRMCeline George
Odoo 17 CRM allows us to track why we lose sales opportunities with "Lost Reasons." This helps analyze our sales process and identify areas for improvement. Here's how to configure lost reasons in Odoo 17 CRM
How to Build a Module in Odoo 17 Using the Scaffold MethodCeline George
Odoo provides an option for creating a module by using a single line command. By using this command the user can make a whole structure of a module. It is very easy for a beginner to make a module. There is no need to make each file manually. This slide will show how to create a module using the scaffold method.
Walmart Business+ and Spark Good for Nonprofits.pdfTechSoup
"Learn about all the ways Walmart supports nonprofit organizations.
You will hear from Liz Willett, the Head of Nonprofits, and hear about what Walmart is doing to help nonprofits, including Walmart Business and Spark Good. Walmart Business+ is a new offer for nonprofits that offers discounts and also streamlines nonprofits order and expense tracking, saving time and money.
The webinar may also give some examples on how nonprofits can best leverage Walmart Business+.
The event will cover the following::
Walmart Business + (https://business.walmart.com/plus) is a new shopping experience for nonprofits, schools, and local business customers that connects an exclusive online shopping experience to stores. Benefits include free delivery and shipping, a 'Spend Analytics” feature, special discounts, deals and tax-exempt shopping.
Special TechSoup offer for a free 180 days membership, and up to $150 in discounts on eligible orders.
Spark Good (walmart.com/sparkgood) is a charitable platform that enables nonprofits to receive donations directly from customers and associates.
Answers about how you can do more with Walmart!"
हिंदी वर्णमाला पीपीटी, hindi alphabet PPT presentation, hindi varnamala PPT, Hindi Varnamala pdf, हिंदी स्वर, हिंदी व्यंजन, sikhiye hindi varnmala, dr. mulla adam ali, hindi language and literature, hindi alphabet with drawing, hindi alphabet pdf, hindi varnamala for childrens, hindi language, hindi varnamala practice for kids, https://www.drmullaadamali.com
বাংলাদেশের অর্থনৈতিক সমীক্ষা ২০২৪ [Bangladesh Economic Review 2024 Bangla.pdf] কম্পিউটার , ট্যাব ও স্মার্ট ফোন ভার্সন সহ সম্পূর্ণ বাংলা ই-বুক বা pdf বই " সুচিপত্র ...বুকমার্ক মেনু 🔖 ও হাইপার লিংক মেনু 📝👆 যুক্ত ..
আমাদের সবার জন্য খুব খুব গুরুত্বপূর্ণ একটি বই ..বিসিএস, ব্যাংক, ইউনিভার্সিটি ভর্তি ও যে কোন প্রতিযোগিতা মূলক পরীক্ষার জন্য এর খুব ইম্পরট্যান্ট একটি বিষয় ...তাছাড়া বাংলাদেশের সাম্প্রতিক যে কোন ডাটা বা তথ্য এই বইতে পাবেন ...
তাই একজন নাগরিক হিসাবে এই তথ্য গুলো আপনার জানা প্রয়োজন ...।
বিসিএস ও ব্যাংক এর লিখিত পরীক্ষা ...+এছাড়া মাধ্যমিক ও উচ্চমাধ্যমিকের স্টুডেন্টদের জন্য অনেক কাজে আসবে ...
Leveraging Generative AI to Drive Nonprofit InnovationTechSoup
In this webinar, participants learned how to utilize Generative AI to streamline operations and elevate member engagement. Amazon Web Service experts provided a customer specific use cases and dived into low/no-code tools that are quick and easy to deploy through Amazon Web Service (AWS.)
Chapter wise All Notes of First year Basic Civil Engineering.pptxDenish Jangid
Chapter wise All Notes of First year Basic Civil Engineering
Syllabus
Chapter-1
Introduction to objective, scope and outcome the subject
Chapter 2
Introduction: Scope and Specialization of Civil Engineering, Role of civil Engineer in Society, Impact of infrastructural development on economy of country.
Chapter 3
Surveying: Object Principles & Types of Surveying; Site Plans, Plans & Maps; Scales & Unit of different Measurements.
Linear Measurements: Instruments used. Linear Measurement by Tape, Ranging out Survey Lines and overcoming Obstructions; Measurements on sloping ground; Tape corrections, conventional symbols. Angular Measurements: Instruments used; Introduction to Compass Surveying, Bearings and Longitude & Latitude of a Line, Introduction to total station.
Levelling: Instrument used Object of levelling, Methods of levelling in brief, and Contour maps.
Chapter 4
Buildings: Selection of site for Buildings, Layout of Building Plan, Types of buildings, Plinth area, carpet area, floor space index, Introduction to building byelaws, concept of sun light & ventilation. Components of Buildings & their functions, Basic concept of R.C.C., Introduction to types of foundation
Chapter 5
Transportation: Introduction to Transportation Engineering; Traffic and Road Safety: Types and Characteristics of Various Modes of Transportation; Various Road Traffic Signs, Causes of Accidents and Road Safety Measures.
Chapter 6
Environmental Engineering: Environmental Pollution, Environmental Acts and Regulations, Functional Concepts of Ecology, Basics of Species, Biodiversity, Ecosystem, Hydrological Cycle; Chemical Cycles: Carbon, Nitrogen & Phosphorus; Energy Flow in Ecosystems.
Water Pollution: Water Quality standards, Introduction to Treatment & Disposal of Waste Water. Reuse and Saving of Water, Rain Water Harvesting. Solid Waste Management: Classification of Solid Waste, Collection, Transportation and Disposal of Solid. Recycling of Solid Waste: Energy Recovery, Sanitary Landfill, On-Site Sanitation. Air & Noise Pollution: Primary and Secondary air pollutants, Harmful effects of Air Pollution, Control of Air Pollution. . Noise Pollution Harmful Effects of noise pollution, control of noise pollution, Global warming & Climate Change, Ozone depletion, Greenhouse effect
Text Books:
1. Palancharmy, Basic Civil Engineering, McGraw Hill publishers.
2. Satheesh Gopi, Basic Civil Engineering, Pearson Publishers.
3. Ketki Rangwala Dalal, Essentials of Civil Engineering, Charotar Publishing House.
4. BCP, Surveying volume 1
This presentation was provided by Steph Pollock of The American Psychological Association’s Journals Program, and Damita Snow, of The American Society of Civil Engineers (ASCE), for the initial session of NISO's 2024 Training Series "DEIA in the Scholarly Landscape." Session One: 'Setting Expectations: a DEIA Primer,' was held June 6, 2024.
How to Make a Field Mandatory in Odoo 17Celine George
In Odoo, making a field required can be done through both Python code and XML views. When you set the required attribute to True in Python code, it makes the field required across all views where it's used. Conversely, when you set the required attribute in XML views, it makes the field required only in the context of that particular view.
it describes the bony anatomy including the femoral head , acetabulum, labrum . also discusses the capsule , ligaments . muscle that act on the hip joint and the range of motion are outlined. factors affecting hip joint stability and weight transmission through the joint are summarized.
3. Think of idea
Break down problem
into tiny steps
Write code for
one step
Run
program
4. Interactive
Development
Environment (IDE)
Code You’ve Instructions for
Written ? Computer
Compiler Executable Program
+ (e.g. .exe or .app)
Linker
+
Loader
5. int x;
int y;
int width;
int height;
size(200, 200);
x = 150;
y = 100;
width = 90;
height = 80;
ellipse(x, y, width, height);
6. int x;
int y;
int width;
ingredients or variables
int height;
size(200, 200);
x = 150;
y = 100;
width = 90;
height = 80;
ellipse(x, y, width, height);
7. int x;
int y;
int width;
ingredients or variables
int height;
size(200, 200);
x = 150;
y = 100; directions or algorithm
width = 90;
height = 80;
ellipse(x, y, width, height);
8. data type
int x;
int y;
int width;
ingredients or variables
int height;
size(200, 200);
x = 150;
y = 100; directions or algorithm
width = 90;
height = 80;
ellipse(x, y, width, height);
9. data type variable name
int x;
int y;
int width;
ingredients or variables
int height;
size(200, 200);
x = 150;
y = 100; directions or algorithm
width = 90;
height = 80;
ellipse(x, y, width, height);
10. DECLARATION VS INITIALISATION
As in a recipe, ingredients
need to be listed at the top
so you know what to buy.
In code, it’s so the compiler
knows how much memory
to reserve. This is called
declaring.
11. DECLARATION VS INITIALISATION
As in a recipe, ingredients
need to be listed at the top
so you know what to buy.
In code, it’s so the compiler
knows how much memory
to reserve. This is called
declaring.
int myInt;
Reserve space for
an int
12. DECLARATION VS INITIALISATION
As in a recipe, ingredients We don’t have to know
need to be listed at the top what value will be stored in
so you know what to buy. myInt right away.
In code, it’s so the compiler We can choose a value
knows how much memory
to reserve. This is called later. This is called initialising.
declaring.
int myInt;
Reserve space for
an int
13. DECLARATION VS INITIALISATION
As in a recipe, ingredients We don’t have to know
need to be listed at the top what value will be stored in
so you know what to buy. myInt right away.
In code, it’s so the compiler We can choose a value
knows how much memory
to reserve. This is called later. This is called initialising.
declaring.
int myInt; myInt = 15;
Reserve space for Store the value 15 in the
an int space reserved for myInt
15
14. Need to declare before or at the same
time as initialisation.
15. Need to declare before or at the same
time as initialisation.
myInt = 3;
int myInt;
16. Need to declare before or at the same
time as initialisation.
myInt = 3; int myInt;
int myInt; myInt = 3;
17. Need to declare before or at the same
time as initialisation.
myInt = 3; int myInt;
int myInt; myInt = 3;
Can’t use a variable before it is initialised.
18. Need to declare before or at the same
time as initialisation.
myInt = 3; int myInt;
int myInt; myInt = 3;
Can’t use a variable before it is initialised.
int myInt;
myInt = myInt + 7;
19. Need to declare before or at the same
time as initialisation.
myInt = 3; int myInt;
int myInt; myInt = 3;
Can’t use a variable before it is initialised.
int myInt; int myInt = 3;
myInt = myInt + 7; myInt = myInt + 7;
20. TO CREATE A VARIABLE
1. Decide what the data type should be. Usually the main
decisions are between int, float and char.
float
int
char
21. TO CREATE A VARIABLE
1. Decide what the data type should be. Usually the main
decisions are between int, float and char.
to create a float type
float
int
char
22. TO CREATE A VARIABLE
1. Decide what the data type should be. Usually the main
decisions are between int, float and char.
to create a float type
float
to create an int type int
char
23. TO CREATE A VARIABLE
1. Decide what the data type should be. Usually the main
decisions are between int, float and char.
to create a float type
float
to create an int type int
to create a char type char
24. TO CREATE A VARIABLE
1. Decide what the data type should be. Usually the main
decisions are between int, float and char.
to create a float type
float
to create an int type int
to create a char type char
2. Decide on a name for your variable. Remember the rules.
25. TO CREATE A VARIABLE
1. Decide what the data type should be. Usually the main
decisions are between int, float and char.
to create a float type
float
to create an int type int
to create a char type char
2. Decide on a name for your variable. Remember the rules.
float scale;
int redValue;
char finalMark;
26. TO CREATE A VARIABLE
1. Decide what the data type should be. Usually the main
decisions are between int, float and char.
to create a float type
float
to create an int type int
to create a char type char
2. Decide on a name for your variable. Remember the rules.
float scale; you get to choose
int redValue; the name
char finalMark;
27. TO CREATE A VARIABLE
1. Decide what the data type should be. Usually the main
decisions are between int, float and char.
to create a float type
float
to create an int type int
to create a char type char
2. Decide on a name for your variable. Remember the rules.
float scale; you get to choose
int redValue; the name
char finalMark;
3. If you already know what the value of that variable is, then go
ahead and set the value.
28. TO CREATE A VARIABLE
1. Decide what the data type should be. Usually the main
decisions are between int, float and char.
to create a float type
float
to create an int type int
to create a char type char
2. Decide on a name for your variable. Remember the rules.
float scale; you get to choose
int redValue; the name
char finalMark;
3. If you already know what the value of that variable is, then go
ahead and set the value.
float scale = 0.5;
int redValue = 199;
char finalMark = ‘B’;
29. TO CREATE A VARIABLE
1. Decide what the data type should be. Usually the main
decisions are between int, float and char.
to create a float type
float
to create an int type int
to create a char type char
2. Decide on a name for your variable. Remember the rules.
float scale; you get to choose
int redValue; the name
char finalMark;
3. If you already know what the value of that variable is, then go
ahead and set the value. if you don’t know the
float scale = 0.5; value yet, stop at step 2.
int redValue = 199; but remember to end
char finalMark = ‘B’; each line with a ;
30. EXERCISE
In Processing, draw a purple quadrilateral using the
quad( ) function.
quad(int x1, int y1, int x2, int y2,
int x3, int y3, int x4, int y4)
Use variables to represent corner of the quadrilateral.
32. int x0 = 20;
int y0 = 20;
int x1 = 30;
int y1 = 50;
int x2 = 150;
int y2 = 50;
int x3 = 160;
int y3 = 20;
size(200, 200);
quad(x0, y0, x1, y1, x2, y2, x3, y3);
33. int x0 = 20;
int y0 = 20;
int x1 = 30;
int y1 = 50; this is a pain to keep track of
int x2 = 150;
int y2 = 50;
int x3 = 160;
int y3 = 20;
size(200, 200);
quad(x0, y0, x1, y1, x2, y2, x3, y3);
34. int x0 = 20;
int y0 = 20;
int x1 = 30;
int y1 = 50; this is a pain to keep track of
int x2 = 150;
int y2 = 50;
int x3 = 160; Wouldn’t it be easier to just
int y3 = 20; have two lists, so only two
variable names: “x” and “y”?
size(200, 200);
quad(x0, y0, x1, y1, x2, y2, x3, y3);
35. What if had a list And a list
called X called Y
X Y
0.) 20 0.) 20
1.) 30 1.) 50
2.)150 2.) 50
3.)160 3.) 20
36. What if had a list And a list
called X called Y
X Y
0.) 20 0.) 20
1.) 30 1.) 50
2.)150 2.) 50
3.)160 3.) 20
So if we just want the number at
2.) in the X list, we’d type
x[2]
37. What if had a list And a list
called X called Y
X Y
0.) 20 0.) 20
That’s all an array is:
1.) 30 1.) 50
a list of things, where we don’t have to
name each thing, just the list.
2.)150 2.) 50
3.)160 3.) 20
So if we just want the number at
2.) in the X list, we’d type
x[2]
38. To create a new list (to declare it):
int[] x = new int[4];
39. To create a new list (to declare it):
what kind of things are in the list?
i.e. how much space needs to be
reserved for each item
int[] x = new int[4];
40. To create a new list (to declare it):
what kind of things are in the list?
i.e. how much space needs to be
reserved for each item
int[] x = new int[4];
[ ] means the data
type is an array
41. To create a new list (to declare it):
what kind of things are in the list?
i.e. how much space needs to be
reserved for each item
int[] x = new int[4];
[ ] means the data
type is an array
what is the name of the list?
42. To create a new list (to declare it):
what kind of things are in the list?
i.e. how much space needs to be
reserved for each item how long will the list be?
int[] x = new int[4];
[ ] means the data
type is an array
what is the name of the list?
43. To initialise a new list :
x[0] = 20;
x[1] = 30;
x[2] = 150;
x[3] = 160;
44. To initialise a new list :
what list are you referring to?
x[0] = 20;
x[1] = 30;
x[2] = 150;
x[3] = 160;
45. To initialise a new list :
what list are you referring to?
x[0] = 20;
x[1] = 30;
x[2] = 150;
x[3] = 160;
which item from the list?
46. To initialise a new list :
what list are you referring to?
what is the value
x[0] = 20; of that item?
x[1] = 30;
x[2] = 150;
x[3] = 160;
which item from the list?
48. what kind of things are in the list?
i.e. how much space needs to be
reserved for each item
int[] x = new int[4];
x[0]
x[1]
x[2]
x[3]
49. what kind of things are in the list?
i.e. how much space needs to be
reserved for each item how long will the list be?
int[] x = new int[4];
x[0]
x[1]
x[2]
x[3]
50. what kind of things are in the list?
i.e. how much space needs to be
reserved for each item how long will the list be?
int[] x = new int[4];
x[0]
x[1] the length of the array and
the data type determine
x[2] how much memory is used
x[3]
51. You can declare and initialise a new list
at the same time :
int[] x = {20, 30, 150, 160};
52. You can declare and initialise a new list
at the same time :
what kind of things are in the list?
i.e. how much space needs to be
reserved for each item
int[] x = {20, 30, 150, 160};
53. You can declare and initialise a new list
at the same time :
what kind of things are in the list?
i.e. how much space needs to be
reserved for each item
int[] x = {20, 30, 150, 160};
[ ] means the data
type is an array
54. You can declare and initialise a new list
at the same time :
what kind of things are in the list?
i.e. how much space needs to be
reserved for each item
int[] x = {20, 30, 150, 160};
[ ] means the data
type is an array
what is the name of the list?
55. You can declare and initialise a new list
at the same time :
what kind of things are in the list?
i.e. how much space needs to be what is the value
reserved for each item of each item?
int[] x = {20, 30, 150, 160};
[ ] means the data
type is an array
what is the name of the list?
56. EXERCISE
In Processing, rewrite this code so that it uses two arrays.
int x0 = 20;
int y0 = 20;
int x1 = 30;
int y1 = 50;
int x2 = 150;
int y2 = 50;
int x3 = 160;
int y3 = 20;
size(200, 200);
quad(x0, y0, x1, y1, x2, y2, x3, y3);
58. 2 tbsp olive oil or sun-dried tomato oil
from the jar 1 tsp dried oregano or a small handful of
fresh leaves, chopped
6 rashers of smoked streaky bacon,
chopped 1 tsp dried thyme or a small handful of
fresh leaves, chopped
2 large onions, chopped
Drizzle balsamic vinegar
3 garlic cloves, crushed
12-14 sun-dried tomato halves, in oil
1kg/2¼lb lean minced beef
Salt and freshly ground black pepper
2 large glasses of red wine
A good handful of fresh basil leaves, torn
2x400g cans chopped tomatoes into small pieces
1x290g jar antipasti marinated 800g-1kg/1¾-2¼lb dried spaghetti
mushrooms, drained
Lots of freshly grated parmesan, to serve
2 fresh or dried bay leaves
1. Heat the oil in a large, heavy-based saucepan and fry the bacon until golden over a medium heat. Add
the onions and garlic, frying until softened. Increase the heat and add the minced beef. Fry it until it
has browned, breaking down any chunks of meat with a wooden spoon. Pour in the wine and boil until
it has reduced in volume by about a third. Reduce the temperature and stir in the tomatoes, drained
mushrooms, bay leaves, oregano, thyme and balsamic vinegar.
2. Either blitz the sun-dried tomatoes in a small blender with a little of the oil to loosen, or just finely chop
before adding to the pan. Season well with salt and pepper. Cover with a lid and simmer the
Bolognese sauce over a gentle heat for 1-1½ hours until it's rich and thickened, stirring occasionally.
At the end of the cooking time, stir in the basil and add any extra seasoning if necessary.
3. Remove from the heat to 'settle' while you cook the spaghetti in plenty of boiling salted water (for the
time stated on the packet). Drain and divide between warmed plates. Scatter a little parmesan over the
spaghetti before adding a good ladleful of the Bolognese sauce, finishing with a scattering of more
cheese and a twist of black
http://www.bbc.co.uk/food/recipes/spaghettibolognese_67868
59. 2 tbsp olive oil or sun-dried tomato oil
from the jar 1 tsp dried oregano or a small handful of
fresh leaves, chopped
6 rashers of smoked streaky bacon,
chopped 1 tsp dried thyme or a small handful of
fresh leaves, chopped
2 large onions, chopped
Drizzle balsamic vinegar
3 garlic cloves, crushed
12-14 sun-dried tomato halves, in oil
1kg/2¼lb lean minced beef
Salt and freshly ground black pepper
2 large glasses of red wine
A good handful of fresh basil leaves, torn
2x400g cans chopped tomatoes into small pieces
1x290g jar antipasti marinated 800g-1kg/1¾-2¼lb dried spaghetti
mushrooms, drained
Lots of freshly grated parmesan, to serve
2 fresh or dried bay leaves
1. Heat the oil in a large, heavy-based saucepan and fry the bacon until golden over a medium heat. Add
the onions and garlic, frying until softened. Increase the heat and add the minced beef. Fry it until it
has browned, breaking down any chunks of meat with a wooden spoon. Pour in the wine and boil until
it has reduced in volume by about a third. Reduce the temperature and stir in the tomatoes, drained
mushrooms, bay leaves, oregano, thyme and balsamic vinegar.
2. Either blitz the sun-dried tomatoes in a small blender with a little of the oil to loosen, or just finely chop
before adding to the pan. Season well with salt and pepper. Cover with a lid and simmer the
Bolognese sauce over a gentle heat for 1-1½ hours until it's rich and thickened, stirring occasionally.
At the end of the cooking time, stir in the basil and add any extra seasoning if necessary.
3. Remove from the heat to 'settle' while you cook the spaghetti in plenty of boiling salted water (for the
time stated on the packet). Drain and divide between warmed plates. Scatter a little parmesan over the
spaghetti before adding a good ladleful of the Bolognese sauce, finishing with a scattering of more
cheese and a twist of black
http://www.bbc.co.uk/food/recipes/spaghettibolognese_67868
60. 2 tbsp olive oil or sun-dried tomato oil
from the jar 1 tsp dried oregano or a small handful of
fresh leaves, chopped
6 rashers of smoked streaky bacon,
chopped 1 tsp dried thyme or a small handful of
fresh leaves, chopped
2 large onions, chopped
Drizzle balsamic vinegar
3 garlic cloves, crushed
12-14 sun-dried tomato halves, in oil
1kg/2¼lb lean minced beef
Salt and freshly ground black pepper
2 large glasses of red wine
A good handful of fresh basil leaves, torn
2x400g cans chopped tomatoes into small pieces
1x290g jar antipasti marinated 800g-1kg/1¾-2¼lb dried spaghetti
mushrooms, drained
Lots of freshly grated parmesan, to serve
2 fresh or dried bay leaves
1. Heat the oil in a large, heavy-based saucepan and fry the bacon until golden over a medium heat. Add
the onions and garlic, frying until softened. Increase the heat and add the minced beef. Fry it until it
has browned, breaking down any chunks of meat with a wooden spoon. Pour in the wine and boil until
it has reduced in volume by about a third. Reduce the temperature and stir in the tomatoes, drained
mushrooms, bay leaves, oregano, thyme and balsamic vinegar.
2. Either blitz the sun-dried tomatoes in a small blender with a little of the oil to loosen, or just finely chop
before adding to the pan. Season well with salt and pepper. Cover with a lid and simmer the
Bolognese sauce over a gentle heat for 1-1½ hours until it's rich and thickened, stirring occasionally.
At the end of the cooking time, stir in the basil and add any extra seasoning if necessary.
3. Remove from the heat to 'settle' while you cook the spaghetti in plenty of boiling salted water (for the
time stated on the packet). Drain and divide between warmed plates. Scatter a little parmesan over the
spaghetti before adding a good ladleful of the Bolognese sauce, finishing with a scattering of more
cheese and a twist of black
http://www.bbc.co.uk/food/recipes/spaghettibolognese_67868
61. 2 tbsp olive oil or sun-dried tomato oil
from the jar 1 tsp dried oregano or a small handful of
fresh leaves, chopped
6 rashers of smoked streaky bacon, We’ve covered how to create
1 tsp dried thyme or a small handful of
chopped
2 large onions, chopped ingredients or variables.
fresh leaves, chopped
Drizzle balsamic vinegar
3 garlic cloves, crushed
12-14 sun-dried tomato halves, in oil
1kg/2¼lb lean minced beef
Salt and freshly ground black pepper
2 large glasses of red wine
A good handful of fresh basil leaves, torn
2x400g cans chopped tomatoes into small pieces
1x290g jar antipasti marinated 800g-1kg/1¾-2¼lb dried spaghetti
mushrooms, drained
Lots of freshly grated parmesan, to serve
2 fresh or dried bay leaves
1. Heat the oil in a large, heavy-based saucepan and fry the bacon until golden over a medium heat. Add
the onions and garlic, frying until softened. Increase the heat and add the minced beef. Fry it until it
has browned, breaking down any chunks of meat with a wooden spoon. Pour in the wine and boil until
it has reduced in volume by about a third. Reduce the temperature and stir in the tomatoes, drained
mushrooms, bay leaves, oregano, thyme and balsamic vinegar.
2. Either blitz the sun-dried tomatoes in a small blender with a little of the oil to loosen, or just finely chop
before adding to the pan. Season well with salt and pepper. Cover with a lid and simmer the
Bolognese sauce over a gentle heat for 1-1½ hours until it's rich and thickened, stirring occasionally.
At the end of the cooking time, stir in the basil and add any extra seasoning if necessary.
3. Remove from the heat to 'settle' while you cook the spaghetti in plenty of boiling salted water (for the
time stated on the packet). Drain and divide between warmed plates. Scatter a little parmesan over the
spaghetti before adding a good ladleful of the Bolognese sauce, finishing with a scattering of more
cheese and a twist of black
http://www.bbc.co.uk/food/recipes/spaghettibolognese_67868
62. 2 tbsp olive oil or sun-dried tomato oil
from the jar 1 tsp dried oregano or a small handful of
fresh leaves, chopped
6 rashers of smoked streaky bacon, We’ve covered how to create
1 tsp dried thyme or a small handful of
chopped
2 large onions, chopped ingredients or variables.
fresh leaves, chopped
Drizzle balsamic vinegar
3 garlic cloves, crushed
12-14 sun-dried tomato halves, in oil
1kg/2¼lb lean minced beef
Salt and freshly ground black pepper
2 large glasses of red wine
A good handful of fresh basil leaves, torn
2x400g cans chopped tomatoes into small pieces
1x290g jar antipasti marinated 800g-1kg/1¾-2¼lb dried spaghetti
mushrooms, drained
Lots of freshly grated parmesan, to serve
2 fresh or dried bay leaves
1. Heat the oil in a large, heavy-based saucepan and fry the bacon until golden over a medium heat. Add
the onions and garlic, frying until softened. Increase the heat and add the minced beef. Fry it until it
has browned, breaking down any chunks of meat with a wooden spoon. Pour in the wine and boil until
it has reduced in volume by about a third. Reduce the temperature and stir in the tomatoes, drained
mushrooms, bay leaves, oregano, thyme and balsamic vinegar.
Now onto the basics of
2. Either blitz the sun-dried tomatoes in a small blender with a little of the oil to loosen, or just finely chop
how to use those variables.
before adding to the pan. Season well with salt and pepper. Cover with a lid and simmer the
Bolognese sauce over a gentle heat for 1-1½ hours until it's rich and thickened, stirring occasionally.
At the end of the cooking time, stir in the basil and add any extra seasoning if necessary.
3. Remove from the heat to 'settle' while you cook the spaghetti in plenty of boiling salted water (for the
time stated on the packet). Drain and divide between warmed plates. Scatter a little parmesan over the
spaghetti before adding a good ladleful of the Bolognese sauce, finishing with a scattering of more
cheese and a twist of black
http://www.bbc.co.uk/food/recipes/spaghettibolognese_67868
64. HOW TO MAKE A DECISION
Once we have some variables, we want to do things with those
variables.
The most basic step is to compare those variables to something
else.
This is done with comparators - questions that can be answered
yes or no (or true or false).
65. HOW TO MAKE A DECISION
Once we have some variables, we want to do things with those
variables.
The most basic step is to compare those variables to something
else.
This is done with comparators - questions that can be answered
yes or no (or true or false).
<
66. HOW TO MAKE A DECISION
Once we have some variables, we want to do things with those
variables.
The most basic step is to compare those variables to something
else.
This is done with comparators - questions that can be answered
yes or no (or true or false).
less than
<
67. HOW TO MAKE A DECISION
Once we have some variables, we want to do things with those
variables.
The most basic step is to compare those variables to something
else.
This is done with comparators - questions that can be answered
yes or no (or true or false).
less than
7 < 4
68. HOW TO MAKE A DECISION
Once we have some variables, we want to do things with those
variables.
The most basic step is to compare those variables to something
else.
This is done with comparators - questions that can be answered
yes or no (or true or false).
less than
7 < 4
FALSE
69. HOW TO MAKE A DECISION
Once we have some variables, we want to do things with those
variables.
The most basic step is to compare those variables to something
else.
This is done with comparators - questions that can be answered
yes or no (or true or false).
70. HOW TO MAKE A DECISION
Once we have some variables, we want to do things with those
variables.
The most basic step is to compare those variables to something
else.
This is done with comparators - questions that can be answered
yes or no (or true or false).
>
71. HOW TO MAKE A DECISION
Once we have some variables, we want to do things with those
variables.
The most basic step is to compare those variables to something
else.
This is done with comparators - questions that can be answered
yes or no (or true or false).
greater than
>
72. HOW TO MAKE A DECISION
Once we have some variables, we want to do things with those
variables.
The most basic step is to compare those variables to something
else.
This is done with comparators - questions that can be answered
yes or no (or true or false).
greater than
7 > 4
73. HOW TO MAKE A DECISION
Once we have some variables, we want to do things with those
variables.
The most basic step is to compare those variables to something
else.
This is done with comparators - questions that can be answered
yes or no (or true or false).
greater than
7 > 4
TRUE
74. OTHER COMPARISONS
greater than or equal to equal to
>= ==
less than or equal to not equal to
<= All of these result
!=
in true or false.
76. put in a comparison
statement (like < or >)
if ( )
{
}
else {
}
77. put in a comparison
statement (like < or >)
if ( )
what to do if our comparison
{ statement is true
}
else {
}
78. put in a comparison
statement (like < or >)
if ( )
what to do if our comparison
{ statement is true
}
else {
}
what to do if our comparison
statement is false
79. put in a comparison
statement (like < or >)
if ( )
what to do if our comparison
{ statement is true
}
we don’t have to
always have an else
else {
statement, sometimes
you only care if the }
statement is true
what to do if our comparison
statement is false
81. If something is true, do an action.
If something isn’t true, instead do a
different action.
82. If something is true, do an action.
If the potatoes are too lumpy,
keep mashing.
If something isn’t true, instead do a
different action.
83. If something is true, do an action.
If the potatoes are too lumpy,
keep mashing.
If something isn’t true, instead do a
different action.
If the potatoes are not too
lumpy, stop mashing.
84. If something is true, do an action.
If the potatoes are too lumpy,
keep mashing. We don’t have to test
this twice. We know if
If something isn’t true, instead do a the potatoes are either
different action. too lumpy or not too
lumpy.
If the potatoes are not too
lumpy, stop mashing.
85. A NOTE ON AXES
When graphing information,
we are used to numbers
86. A NOTE ON AXES
When graphing information,
we are used to numbers
increasing as we move right
87. A NOTE ON AXES
When graphing information,
we are used to numbers
and increasing as
we move up
increasing as we move right
88. A NOTE ON AXES
This is different to how numbers
work with programming graphics.
89. A NOTE ON AXES
Numbers start in the
upper left corner at the
origin (0, 0)
This is different to how numbers
work with programming graphics.
90. A NOTE ON AXES
Numbers start in the
upper left corner at the
origin (0, 0)
This is different to how numbers
work with programming graphics.
and increase as we move right
91. A NOTE ON AXES
Numbers start in the
upper left corner at the
origin (0, 0)
This is different to how numbers
and increase as we
work with programming graphics.
move down
and increase as we move right
92. EXERCISE
Create a Processing sketch which draws a green circle if the
mouse is in the top half of the window and changes the circle’s
colour to red if the mouse in the bottom half of the window.
Start with the code below.
void setup() {
// create the window
size(400, 400);
}
void draw() {
// set the colour
fill(10, 10, 255);
// draw the circle
ellipse(mouseX, mouseY, 100, 100);
}
93. What if we want to use multiple if statements?
int counter;
// some other code...
if (counter < 10) {
if (counter > 0 ) {
counter++;
}
}
94. What if we want to use multiple if statements?
If counter is less than 10
and greater than 0, then
int counter; increase counter by 1.
// some other code...
if (counter < 10) {
if (counter > 0 ) {
counter++;
}
}
95. What if we want to use multiple if statements?
If counter is less than 10
and greater than 0, then
int counter; increase counter by 1.
// some other code...
if (counter < 10) {
if (counter > 0 ) {
counter++;
}
} counter is only increased if
both if statements are true.
96. What if we want to use multiple if statements?
If counter is less than 10
and greater than 0, then
int counter; increase counter by 1.
// some other code...
if (counter < 10) {
if (counter > 0 ) {
counter++;
}
} counter is only increased if
These are called nested if both if statements are true.
statements, because one is
inside the { } of the other.
97. What if we want to use multiple if statements?
int counter;
// some other code...
if (counter > 10) {
counter = 0;
}
if (counter < 0 ) {
}
counter = 0;
}
98. What if we want to use multiple if statements?
If counter is greater than 10 or less
than 0, then reset counter to 0.
int counter;
// some other code...
if (counter > 10) {
counter = 0;
}
if (counter < 0 ) {
}
counter = 0;
}
99. What if we want to use multiple if statements?
If counter is greater than 10 or less
than 0, then reset counter to 0.
int counter;
// some other code...
if (counter > 10) {
counter = 0;
}
if (counter < 0 ) {
}
counter = 0;
} counter is reset
if either if
statements are true.
102. BOOLEAN OPERATOR OR
True OR False is True
False OR True is True
True OR True is
False OR False is
103. BOOLEAN OPERATOR OR
True OR False is True
False OR True is True
True OR True is True
False OR False is
104. BOOLEAN OPERATOR OR
True OR False is True
False OR True is True
True OR True is True
False OR False is False
105. BOOLEAN OPERATOR OR
True OR False is True
False OR True is True
When using OR in
code, type ||
True OR True is True
False OR False is False
106. BOOLEAN OPERATOR AND
True AND False is
False AND True is
True AND True is
False AND False is
107. BOOLEAN OPERATOR AND
True AND False is False
False AND True is
True AND True is
False AND False is
108. BOOLEAN OPERATOR AND
True AND False is False
False AND True is False
True AND True is
False AND False is
109. BOOLEAN OPERATOR AND
True AND False is False
False AND True is False
True AND True is True
False AND False is
110. BOOLEAN OPERATOR AND
True AND False is False
False AND True is False
True AND True is True
False AND False is False
111. BOOLEAN OPERATOR AND
True AND False is False
False AND True is False
When using OR in
code, type &&
True AND True is True
False AND False is False
115. BOOLEAN OPERATOR NOT
NOT True is False
NOT False is True
When using NOT in
code, type !
116. EXERCISE
Modify your Processing sketch which draws a green circle if the
mouse is in the top half of the window and changes the circle’s
colour to red if the mouse in the bottom half of the window.
Now using the AND statement, draw
• a green circle in the upper left quadrant of the window,
• a blue circle in the upper right quadrant,
• a red circle in the lower left quadrant,
• and a yellow circle in the lower right quadrant.
118. LOOPS
There are two ways to
repeat something:
1. Do this N number of
times.
2. Keep doing this until
something else happens.
119. LOOPS
There are two ways to
repeat something:
Repeat this event in
1. Do this N the calendar of
number this
times. many times.
2. Keep doing this until
something else happens.
120. LOOPS
There are two ways to
repeat something:
Repeat this event in
1. Do this N the calendar of
number this
times. many times.
2. Keep doing this event in the
Repeat this until
calendar until a certain
something else occurs.
date happens.
121. DO THIS N TIMES
int i;
for(i=0; i<4; i++) {
}
122. DO THIS N TIMES
start with a number, in
this case 0
int i;
for(i=0; i<4; i++) {
}
123. DO THIS N TIMES
start with a number, in if this statement is
this case 0 true
int i;
for(i=0; i<4; i++) {
}
124. DO THIS N TIMES
start with a number, in if this statement is
this case 0 true
int i;
for(i=0; i<4; i++) {
}
then do whatever is
written here
125. DO THIS N TIMES
start with a number, in if this statement is
this case 0 true
int i;
for(i=0; i<4; i++) {
}
when you’ve done what’s
then do whatever is in the { } once, do this, in
written here this case add make i equal
to its current value plus 1
126. DO THIS N TIMES
start with a number, in if this statement is
true go back to see if the
this case 0 middle statement is still
int i; true
for(i=0; i<4; i++) {
}
when you’ve done what’s
then do whatever is in the { } once, do this, in
written here this case add make i equal
to its current value plus 1
128. KEEP DOING THIS UNTIL
SOMETHING ELSE HAPPENS
if the statement here is true
while ( ) {
}
129. KEEP DOING THIS UNTIL
SOMETHING ELSE HAPPENS
if the statement here is true
while ( ) {
}
then do what is between { } once
130. KEEP DOING THIS UNTIL
SOMETHING ELSE HAPPENS
if the statement here is true
while ( ) {
then repeat by checking
the statement again
}
then do what is between { } once
131. EXERCISE
Write out each iteration of these loops and what the variables
equal at the end of each loop.
int i;
int j = 15; int k = 100;
for (i=0; i<12; i++) while ( k > 0 ) {
{ k = k -10;
j = j * 2 - i; }
}