1 / 8

BTEC Unit 06 – Lesson 06 Evidencing P4

BTEC Unit 06 – Lesson 06 Evidencing P4. Mr C Johnston ICT Teacher www.computechedu.co.uk. Session Objectives. Understand different data types there formats and use Be able to use the correct data type for a variable storing a specific value, Understand the grading requirements of P4.

diella
Download Presentation

BTEC Unit 06 – Lesson 06 Evidencing P4

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. BTEC Unit 06 – Lesson 06Evidencing P4 Mr C Johnston ICT Teacher www.computechedu.co.uk

  2. Session Objectives • Understand different data types there formats and use • Be able to use the correct data type for a variable storing a specific value, • Understand the grading requirements of P4.

  3. Data Types???

  4. Data Types • We know from lesson 05 that every variable needs to be assigned a data type, • The data type sets the type of data which will be stored within it and the range of values it can accept and how the data will be formatted when displayed, • Although data types vary from programming language to programming language most support similar ones, • The next slide shows some of the data types which are supported in visual basic.

  5. Visual Basic Data Types

  6. Choosing Data Types • Assigning the correct data type to a variable is important for example: • Choosing a data type with a capacity to store more data than will ever be required is wasteful, • Choosing a data type that is too small for the value being stored can crash the program, • Text cant be stored in numerical data types however any characters can be stored in strings, • Numerical data cant start in a 0 as its breaks the rules of maths learnt at primary school, • If you need to perform calculations and comparison of numerical data then its cant be stored as text, • If a data item is to be used in different parts of the program then its type needs to be consistent, • Code can be used to change the data type of a variable e.g. cint(variable) or clng(variable) or cstr(variable)

  7. Evidencing P4 • P4 asks you to produce some further slides in your presentation which explain why different data types are needed and the benefits to programmers of having a range of data types to work with, • Start off by explaining the different data types available and what each is used for – include some sensible examples, • Think about the space occupied for each and why it might be useful compared to other types, • Make a comment about which data types seem to be common in different programming languages and which are proprietary, • Write a some notes which explains why it is important to choose the correct data type and some of problems if the programmer gets it wrong.

  8. P4 – explain why different data types are needed in programs and describe the benefits of having a variety of data types available to the programmer • A written response for P4 may be appropriate, or a table with perhaps three or four columns: data type, example, space occupied and comment. • The data types available may be different according to which language is chosen, however there is an expectation that learners know of the wider range of data types available, six would be sufficient. Visual Basic Data Types: http://msdn.microsoft.com/en-us/library/47zceaw7(v=vs.80).aspx Java Data Types: http://www.tutorialspoint.com/java/java_basic_datatypes.htm C++ Data Types: http://www.tutorialspoint.com/cplusplus/cpp_data_types.htm Pascal Data Types: http://www.tutorialspoint.com/pascal/pascal_data_types.htm

More Related