Subjects

Subjects

Companies

2.2.1 Programming fundamentals

19

Share

Save


charset="7php bloginfo(
"viewport" content="width-de
php up title( '/', true, 'right'
rel"profile" href="http://gmpg.org/xfa/11
rela"pingbac

Sign up

Sign up to get unlimited access to thousands of study materials. It's free!

Access to all documents

Join milions of students

Improve your grades

By signing up you accept Terms of Service and Privacy Policy

charset="7php bloginfo(
"viewport" content="width-de
php up title( '/', true, 'right'
rel"profile" href="http://gmpg.org/xfa/11
rela"pingbac

Sign up

Sign up to get unlimited access to thousands of study materials. It's free!

Access to all documents

Join milions of students

Improve your grades

By signing up you accept Terms of Service and Privacy Policy

charset="7php bloginfo(
"viewport" content="width-de
php up title( '/', true, 'right'
rel"profile" href="http://gmpg.org/xfa/11
rela"pingbac

Sign up

Sign up to get unlimited access to thousands of study materials. It's free!

Access to all documents

Join milions of students

Improve your grades

By signing up you accept Terms of Service and Privacy Policy

charset="7php bloginfo(
"viewport" content="width-de
php up title( '/', true, 'right'
rel"profile" href="http://gmpg.org/xfa/11
rela"pingbac

Sign up

Sign up to get unlimited access to thousands of study materials. It's free!

Access to all documents

Join milions of students

Improve your grades

By signing up you accept Terms of Service and Privacy Policy

charset="7php bloginfo(
"viewport" content="width-de
php up title( '/', true, 'right'
rel"profile" href="http://gmpg.org/xfa/11
rela"pingbac

Sign up

Sign up to get unlimited access to thousands of study materials. It's free!

Access to all documents

Join milions of students

Improve your grades

By signing up you accept Terms of Service and Privacy Policy

charset="7php bloginfo( "viewport" content="width-de php up title( '/', true, 'right' rel"profile" href="http://gmpg.org/xfa/11 rela"pingback" href="<?php bloginfol pinghack ar e fruitful_get_favicon(); ?> lit it IE 9]><script src="<?php echo pet template ho wp_head(); ?> ody <?php body_class(); ?>> <div id="page-header" class="hfeed sites <?php $theme_options = fruitful get the commi $logo_pos= $menu_pos= if (isset($theme_options['no $logo_pos= esc_attrist 2.1.2 Programming Fundamentals fruit if (isset($theme options menu posesc attri Computing MOC Constants and Variables Data can either be stored as a constant or a variable. The name of the constant or variable is linked to a memory location that stores the data value. A constant <-> A data value that can't be changed, usually assigned to at the start of a program A variable <-> A data value that can be changed at any time Assigning constants You might have to assign to a constant using code (something like const SIZE = 40 depending on the language you're using). It is good practice to assign constants in all upper-case Operators Programming languages have different types of operator to assign, compare and do arithmetic between different variables. Assignment Operator There is one assignment variable, that is used to assign values to constants or variables. For example: name = "Gregg" favorite food = "Cheese" age = 34 Comparison Operators Comparison operators compare one value to another Operator Meaning != < V <= >= Is equal to Is not equal to Is less than Is greater than Is less than or equal to Is greater than or equal to = and == Don't get...

Can't find what you're looking for? Explore other subjects.

Knowunity is the # 1 ranked education app in five European countries

Knowunity is the # 1 ranked education app in five European countries

Knowunity was a featured story by Apple and has consistently topped the app store charts within the education category in Germany, Italy, Poland, Switzerland and United Kingdom. Join Knowunity today and help millions of students around the world.

Ranked #1 Education App

Download in

Google Play

Download in

App Store

Still not sure? Look at what your fellow peers are saying...

iOS User

I love this app so much [...] I recommend Knowunity to everyone!!! I went from a C to an A with it :D

Stefan S, iOS User

The application is very simple and well designed. So far I have found what I was looking for :D

SuSSan, iOS User

Love this App ❤️, I use it basically all the time whenever I'm studying

Alternative transcript:

mixed up between = and == operators, one will assign a value, and one will check if the value is true Function Addition Arithmetic Operators Arithmetic operators take two values and perform a maths function on them Subtraction Multiplication Division Exponentiation Quotient Remainder Operator + * ^ DIV MOD or % These operators can work on integers or real data values, or a combination of the two. Computers will always use BIDMAS, so make sure to use operators in the right order, or use brackets so it does the right program. Boolean Operators Boolean operators are used in 2.4.1 Boolean logic and there are three we need to know: Boolean operator AND OR NOT && || For example: ! Example that returns true 3<5 AND 2>1 1>8 OR 2 ==2 NOT (5>8 You can combine Boolean operators, but you must use brackets so the computer knows what part to do first Program Flow Sequence Sequence -> executing each instruction once in the order its given in a program name = input "What is your name? >>>" print("Hello + "+name+" , my name is Andy") This program is executed in order Selection Sometimes, you don't want to execute all your code at once. You may need the program to select what top execute at different times. We use conditional statements to test a variable against another and see what to execute. For example, this flow chart shows selection: Start Print "Access granted." True if x == "GO" else: Input x X == "GO"? Stop False x = input "Please input the special word >>>" "Access denied." print "Correct, access granted" print "Incorrect, access denied" Print In this example, there are two bits of code the program could print, depending on user input. You can nest if statements to make more complex programs and more outputs. Or you can use else if statements to make more checks on a condition. For loops For loops will repeat code inside them for a fixed number of times for k = 1 to 100: # this will repeat 100 times print k next k Or you can use them to iterate over lists, like in python list = ["Mouse", "Keyboard", "Monitor" for item in list. print item # This will print each item in the list While Loops While Loops continue until an condition is met Is the condition true? Yes Part of the program to repeat No

2.2.1 Programming fundamentals

19

Share

Save

Computer Science

 

10/11

Revision note

user profile picture

Reuben Cowell

75 Followers

Comments (1)

charset="7php bloginfo(
"viewport" content="width-de
php up title( '/', true, 'right'
rel"profile" href="http://gmpg.org/xfa/11
rela"pingbac
charset="7php bloginfo(
"viewport" content="width-de
php up title( '/', true, 'right'
rel"profile" href="http://gmpg.org/xfa/11
rela"pingbac
charset="7php bloginfo(
"viewport" content="width-de
php up title( '/', true, 'right'
rel"profile" href="http://gmpg.org/xfa/11
rela"pingbac
charset="7php bloginfo(
"viewport" content="width-de
php up title( '/', true, 'right'
rel"profile" href="http://gmpg.org/xfa/11
rela"pingbac
charset="7php bloginfo(
"viewport" content="width-de
php up title( '/', true, 'right'
rel"profile" href="http://gmpg.org/xfa/11
rela"pingbac

my notes on programming fundamentals

Similar Content

Know OCR Computer Science Paper 2 thumbnail

0

OCR Computer Science Paper 2

OCR Computer Science Paper 2 GCSE

Know GCSE CS Component 2 revision notes  thumbnail

4

GCSE CS Component 2 revision notes

Learn about Bubble, Insertion, and Merge sort algorithms, their advantages, disadvantages, and examples. Understand how each sort works for exam preparation.

Know CS OCR   thumbnail

86

CS OCR

computer science notes ocr

Know Python Basics 1 thumbnail

4

Python Basics 1

Print statements,data types,comments,variables (will be doing more soon !!)

Know Software Design and Development Notes thumbnail

0

Software Design and Development Notes

notes for everything we need to know for the nat 5 computing science exam in the software section(from achieve and from my class notes)

Know Guide to python coding - Basics and If statements thumbnail

43

Guide to python coding - Basics and If statements

This guide and summary of python will allow you to understand the basics of python coding and allow you to do basic coding which you can then develop into advanced coding

charset="7php bloginfo( "viewport" content="width-de php up title( '/', true, 'right' rel"profile" href="http://gmpg.org/xfa/11 rela"pingback" href="<?php bloginfol pinghack ar e fruitful_get_favicon(); ?> lit it IE 9]><script src="<?php echo pet template ho wp_head(); ?> ody <?php body_class(); ?>> <div id="page-header" class="hfeed sites <?php $theme_options = fruitful get the commi $logo_pos= $menu_pos= if (isset($theme_options['no $logo_pos= esc_attrist 2.1.2 Programming Fundamentals fruit if (isset($theme options menu posesc attri Computing MOC Constants and Variables Data can either be stored as a constant or a variable. The name of the constant or variable is linked to a memory location that stores the data value. A constant <-> A data value that can't be changed, usually assigned to at the start of a program A variable <-> A data value that can be changed at any time Assigning constants You might have to assign to a constant using code (something like const SIZE = 40 depending on the language you're using). It is good practice to assign constants in all upper-case Operators Programming languages have different types of operator to assign, compare and do arithmetic between different variables. Assignment Operator There is one assignment variable, that is used to assign values to constants or variables. For example: name = "Gregg" favorite food = "Cheese" age = 34 Comparison Operators Comparison operators compare one value to another Operator Meaning != < V <= >= Is equal to Is not equal to Is less than Is greater than Is less than or equal to Is greater than or equal to = and == Don't get...

charset="7php bloginfo( "viewport" content="width-de php up title( '/', true, 'right' rel"profile" href="http://gmpg.org/xfa/11 rela"pingback" href="<?php bloginfol pinghack ar e fruitful_get_favicon(); ?> lit it IE 9]><script src="<?php echo pet template ho wp_head(); ?> ody <?php body_class(); ?>> <div id="page-header" class="hfeed sites <?php $theme_options = fruitful get the commi $logo_pos= $menu_pos= if (isset($theme_options['no $logo_pos= esc_attrist 2.1.2 Programming Fundamentals fruit if (isset($theme options menu posesc attri Computing MOC Constants and Variables Data can either be stored as a constant or a variable. The name of the constant or variable is linked to a memory location that stores the data value. A constant <-> A data value that can't be changed, usually assigned to at the start of a program A variable <-> A data value that can be changed at any time Assigning constants You might have to assign to a constant using code (something like const SIZE = 40 depending on the language you're using). It is good practice to assign constants in all upper-case Operators Programming languages have different types of operator to assign, compare and do arithmetic between different variables. Assignment Operator There is one assignment variable, that is used to assign values to constants or variables. For example: name = "Gregg" favorite food = "Cheese" age = 34 Comparison Operators Comparison operators compare one value to another Operator Meaning != < V <= >= Is equal to Is not equal to Is less than Is greater than Is less than or equal to Is greater than or equal to = and == Don't get...

Can't find what you're looking for? Explore other subjects.

Knowunity is the # 1 ranked education app in five European countries

Knowunity is the # 1 ranked education app in five European countries

Knowunity was a featured story by Apple and has consistently topped the app store charts within the education category in Germany, Italy, Poland, Switzerland and United Kingdom. Join Knowunity today and help millions of students around the world.

Ranked #1 Education App

Download in

Google Play

Download in

App Store

Still not sure? Look at what your fellow peers are saying...

iOS User

I love this app so much [...] I recommend Knowunity to everyone!!! I went from a C to an A with it :D

Stefan S, iOS User

The application is very simple and well designed. So far I have found what I was looking for :D

SuSSan, iOS User

Love this App ❤️, I use it basically all the time whenever I'm studying

Alternative transcript:

mixed up between = and == operators, one will assign a value, and one will check if the value is true Function Addition Arithmetic Operators Arithmetic operators take two values and perform a maths function on them Subtraction Multiplication Division Exponentiation Quotient Remainder Operator + * ^ DIV MOD or % These operators can work on integers or real data values, or a combination of the two. Computers will always use BIDMAS, so make sure to use operators in the right order, or use brackets so it does the right program. Boolean Operators Boolean operators are used in 2.4.1 Boolean logic and there are three we need to know: Boolean operator AND OR NOT && || For example: ! Example that returns true 3<5 AND 2>1 1>8 OR 2 ==2 NOT (5>8 You can combine Boolean operators, but you must use brackets so the computer knows what part to do first Program Flow Sequence Sequence -> executing each instruction once in the order its given in a program name = input "What is your name? >>>" print("Hello + "+name+" , my name is Andy") This program is executed in order Selection Sometimes, you don't want to execute all your code at once. You may need the program to select what top execute at different times. We use conditional statements to test a variable against another and see what to execute. For example, this flow chart shows selection: Start Print "Access granted." True if x == "GO" else: Input x X == "GO"? Stop False x = input "Please input the special word >>>" "Access denied." print "Correct, access granted" print "Incorrect, access denied" Print In this example, there are two bits of code the program could print, depending on user input. You can nest if statements to make more complex programs and more outputs. Or you can use else if statements to make more checks on a condition. For loops For loops will repeat code inside them for a fixed number of times for k = 1 to 100: # this will repeat 100 times print k next k Or you can use them to iterate over lists, like in python list = ["Mouse", "Keyboard", "Monitor" for item in list. print item # This will print each item in the list While Loops While Loops continue until an condition is met Is the condition true? Yes Part of the program to repeat No