Разделы презентаций


Data types

Most programming languages have built in data types that are used when declaring variables. Some common data types, and the ones you need to know for the exam, are as follows:

Слайды и текст этой презентации

Слайд 1Data types
Objectives: 1. Explain the need for a range of

different data types including Boolean, integer, decimal, date/time, character, string
2.

Explain the purpose of data types within code, justify the selection of data structures for given situations

Data typesObjectives: 1. Explain the need for a range of different data types including Boolean, integer, decimal,

Слайд 2Most programming languages have built in data types that are

used when declaring variables. Some common data types, and the

ones you need to know for the exam, are as follows:
Most programming languages have built in data types that are used when declaring variables. Some common data

Слайд 3Examples of declaration
! Notice that we can assign value to

a variable in declaration stage

Examples of declaration! Notice that we can assign value to a variable in declaration stage

Слайд 4Every data type has its own size
We need to remember

that it’s better to use least
memory-expensive type for each

variable

!

Every data type has its own sizeWe need to remember that it’s better to use least memory-expensive

Слайд 5Situation 1
We have to declare a data type for a

variables:
numberOfstudentsInGroup
numberOfstudentsInSchool
numberOfstudentsInKazakhstan

Which one data type we should use for

each of them? Try to explain your choice.
Situation 1We have to declare a data type for a variables: numberOfstudentsInGroupnumberOfstudentsInSchoolnumberOfstudentsInKazakhstan Which one data type we

Слайд 6What is the difference between integer and float?

What is the difference between integer and float?

Слайд 7Situation 2
We have to declare a data type for a

variables:
ageOfstudent
averageAgeOfstudent
maxAgeOfstudent

Which one data type we should use for each

of them? Try to explain your choice.

Situation 2We have to declare a data type for a variables: ageOfstudentaverageAgeOfstudentmaxAgeOfstudentWhich one data type we should

Слайд 8What is the difference between char and string?

What is the difference between char and string?

Слайд 9Situation 3
We have to declare a data type for a

variables:
genderOfstudent
nameOfstudent
maxAgeOfstudent

Which one data type we should use for each

of them? Try to explain your choice.


Situation 3We have to declare a data type for a variables: genderOfstudentnameOfstudentmaxAgeOfstudentWhich one data type we should

Слайд 10DateTime data type
The DateTime is a value type. It represents

an instant in time, typically expressed as a date and

time of day.

DateTime data typeThe DateTime is a value type. It represents an instant in time, typically expressed as

Слайд 11Exercise 1
Using the correct datatype declare variables for a person's:


Name
Age
Gender
Height(metres)
Date of Birth
license (Do they have a driver license)


Exercise 1Using the correct datatype declare variables for a person's: NameAgeGenderHeight(metres)Date of Birthlicense (Do they have a

Слайд 12Exercise 2
Which of the following declarations correct, which are wrong

and why?

Exercise 2Which of the following declarations correct, which are wrong and why?

Слайд 13Exercise 3
Write assignment statements for the following variables using yourself

as an example:
Name
Age
Gender

Exercise 3Write assignment statements for the following variables using yourself as an example: NameAgeGender

Слайд 14Exercise 4
Which of the following declarations correct, which are wrong

and why?




Exercise 4Which of the following declarations correct, which are wrong and why?

Слайд 15Exercise 5
Give two reasons why is it important to get

the correct datatypes:
1 ___________________________
2 ___________________________

Exercise 5Give two reasons why is it important to get the correct datatypes:1 ___________________________2 ___________________________

Слайд 16Exercise 6
Write code that asks the user to insert the

date of birth. Calculate the age of a student.

Exercise 6Write code that asks the user to insert the date of birth. Calculate the age of

Слайд 17Exercise 7

Create a form for a student that will
have:

name, surname, age, height,
group, gender.




Exercise 7Create a form for a student that will have: name, surname, age, height, group, gender.

Обратная связь

Если не удалось найти и скачать доклад-презентацию, Вы можете заказать его на нашем сайте. Мы постараемся найти нужный Вам материал и отправим по электронной почте. Не стесняйтесь обращаться к нам, если у вас возникли вопросы или пожелания:

Email: Нажмите что бы посмотреть 

Что такое TheSlide.ru?

Это сайт презентации, докладов, проектов в PowerPoint. Здесь удобно  хранить и делиться своими презентациями с другими пользователями.


Для правообладателей

Яндекс.Метрика