Starter – Its the small things in life What’s wrong with this code Height = 10 Width = 10 A = Height * Width Print A Remember to check: Spelling Spacing Capital letters Height = 10 Width = 10 A = Height * 10 Print A
Computer Science Constants_variables and data types 2 part 2
Success Criteria Be able to describe the difference between a constant and a variable. To be able to write simple programs using some variables and constants To be able to assign some data types to data
Introducing the pseudocode Task 1 = What am I working out Width ← 10 Height ← 10 A ← Width * Height print A
Introducing the pseudocode Task 1 = What am I working out Width ← user input Height ← user input A ← Width * Height print “Your answer is” + A “Your answers is...” is a string BUT is A? Str(A)
Problem solving - Take that working code you have created. Work out the area of triangle.
Problem solving - Okay – what have we learnt? Without me: Three people have meals and drinks Work out the total for the meal Then add 20% tax (VAT)on the end Work out the total + tax (VAT) TIP - Use pseudo code if you have to plan it out.
Key questions Can you identify differences between constants and variables. Can you write simple programs using some variables and constants Can you assign some data types to data
Extension Practice, practice and practice
Homework 4 pieces of programming code (that work) that demonstrate the use of constants and variables. Annotate each code to show constants and variables + data types you have assigned.