Оцените презентацию от 1 до 5 баллов!
Тип файла:
ppt / pptx (powerpoint)
Всего слайдов:
13 слайдов
Для класса:
1,2,3,4,5,6,7,8,9,10,11
Размер файла:
507.00 kB
Просмотров:
64
Скачиваний:
0
Автор:
неизвестен
Слайды и текст к этой презентации:
№1 слайд
№2 слайд
Содержание слайда: Data Types
№3 слайд
Содержание слайда: What are Variables?
What are Variables?
The Data Types supported by VB
Understand why Data Types are used
№4 слайд
Содержание слайда: When a program runs, any data it uses must be stored in RAM
When a program runs, any data it uses must be stored in RAM
A variable is a name made up by a programmer to identify the address in RAM where a piece of data is stored
Every variable must be of a given data type (see word document “Data Types”)
№5 слайд
Содержание слайда: To declare a variable means to tell Visual Basic two things about it
To declare a variable means to tell Visual Basic two things about it
Its name
Its data type
Use the keywords Dim and As when you declare a variable, for example
Dim Number As Integer
Dim Payment As Decimal
Dim DateOfPayment As Date
№6 слайд
Содержание слайда: You can declare more than one variable of the same type in the same line of code, for example
You can declare more than one variable of the same type in the same line of code, for example
Dim FirstNumber, SecondNumber, ThirdNumber As Integer
№7 слайд
Содержание слайда: See “Data Types” document
See “Data Types” document
№8 слайд
Содержание слайда: Data Types are used to determine what type of information is going to be stored in a variable (will it be a date, a number or some text)
Data Types are used to determine what type of information is going to be stored in a variable (will it be a date, a number or some text)
Data Types also determine how much space in memory (RAM) the variable needs to store the information
Each Data Type has a maximum size (this is what has the impact on memory)
Important to choose the correct Data Type for variables to ensure that the most efficient amount of storage space needed is used
№9 слайд
Содержание слайда: Data Types are also used to help validate what is being stored in each variable (since VB will present you with an error message if you put a different type of value in a variable with the wrong data type)
Data Types are also used to help validate what is being stored in each variable (since VB will present you with an error message if you put a different type of value in a variable with the wrong data type)
For example, VB will not let you put text or numbers into a variable with a Date data type
And VB will not let you put text into a field with a Number data type
The result will be that the program will “fall-over” displaying an error message
№10 слайд
Содержание слайда: Having different Data Types allows you to perform calculation on the different values of variable (such as Adding values of variables)
Having different Data Types allows you to perform calculation on the different values of variable (such as Adding values of variables)
Having different Data Types also allows different formatting to be applied to the field when you create reports or data entry screen
For example, a Date field in VB (just like in Access) can be printed or displayed with the following different formats
11/09/2011
11 Sept 2011
11 September 2011
№11 слайд
Содержание слайда: Accurate storage
Accurate storage
This is vitally important for numeric values. If the data type is too small to store a value, it becomes truncated (chopped) and accuracy is lost.
Using a data type of the right size prevents this happening
Efficiency of storage
This is important particularly in computer systems where free RAM or processing power may be limited
Additional validation
Entering non-numeric data into a numeric data type can cause a program to crash at runtime
№12 слайд
Содержание слайда: Calculations
Calculations
Data that you need to do calculations with must be placed in a numeric data type such as integer or single
Placing non-numeric data into these variables, will result in the program crashing
Formatting
By having data types you can take advantage of the formatting that can be applied to each type and make the presentation of information stored in variable appear more user friendly
Consistency
Data types give the programmer the ability to have variables that have a consistent style throughout the program (with a consistent format and options)
№13 слайд
Содержание слайда: Create a table in word to list some of the data types that are available in Visual Basic, with their size, space taken up (in RAM) and the short/brief description of the type of data that should be stored in the data type (include some examples)
Create a table in word to list some of the data types that are available in Visual Basic, with their size, space taken up (in RAM) and the short/brief description of the type of data that should be stored in the data type (include some examples)
Under the table provide a description of the benefits gained by having a variety of different data types available when producing programs